From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ec1cbb3f01d2cff2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 26 May 2005 18:49:15 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1117128009.277967.14010@g14g2000cwa.googlegroups.com> <86bcmsy3e49m.yjhfcxtf7osr.dlg@40tude.net> Subject: Re: Direct_IO and files of tagged types Date: Thu, 26 May 2005 18:51:47 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-49DWBdXbpvTJR5/Tp5GKAv+QiOkWP7b4BI9o0XqJRjsfRKLwdk6gAkGZDAdUsvwFvaPXo/sTD8GZ8Yl!dOOZwekgRU5pT2Jhi+lVu+QfwEAcrpmpt0WXWvQjiRHI2+xLYTRMTb7MtwDfifg08fAdBKX9dfJG X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:11175 Date: 2005-05-26T18:51:47-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:86bcmsy3e49m.yjhfcxtf7osr.dlg@40tude.net... > On 26 May 2005 10:20:09 -0700, John McCormick wrote: > > > When I instantiate a version of Ada.Direct_IO with an element type that > > is statically tagged (it is of a specific tagged type) GNAT gives me a > > warning that the element type contains an access value. My tagged type > > has three integer fields - no access types. I assume that the access > > type referenced in the warning is to the tag mechanism. Any suggestions > > for ways to create binary files of statically tagged objects? > > It is not a good idea to write tags into a file even if they are statically > known, because that cannot be portable. Another general question is: if the > tag is always known what for to have it? Without dispatching tags are just > useless overhead! If the object is derived from Controlled, it will be tagged even if no (explicit) dispatching is used. And I think that virtually all ADT types should be controlled and extensible -- so virtually all types will have tags. At worst the overhead is "useless" now; but that probably will change in the future. My suggestion to John would be to abandon Direct_IO and use Streams instead; 'Write doesn't write the tag, and Stream_IO allows positioning. Once a type is tagged, you usually want a hetrogeneous file anyway (that is, the type probably ought to be T'Class, which isn't going to work with Direct_IO, and is dubious with Sequential_IO). Randy.