Re: Direct_IO and files of tagged types



On Thu, 26 May 2005 18:51:47 -0500, Randy Brukardt wrote:

> "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx> wrote in message
> news:86bcmsy3e49m.yjhfcxtf7osr.dlg@xxxxxxxxxxxxx
>> 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

Right.

> -- so virtually all types will have
> tags. At worst the overhead is "useless" now; but that probably will change
> in the future.

What for? T'Class should have a tag. T should not.

Provided that T is not a by-reference, limited type then there is no any
good reason to put its tag into. I would really like to have *non-tagged*
controlled and extensible types for which I could have T'Class. Such types
could then be safely used in Direct_IO.

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: Bug in VS XML Editor?
    ... Error 2 Expecting end tag. ... Warning 3 The 'Something' element is not declared. ... your schema, this warning goes away. ... Can anybody could confirm if this is a bug??? ...
    (microsoft.public.vstudio.general)
  • Re: [PATCH 0/6] loglevel=pci:8,acpi:8,apic=8 support v6
    ... fix some checkpatch error and warning ... not just one susbsys one tag, and don't need to update kernel.h to add more tags ...
    (Linux-Kernel)
  • [PATCH 0/7] loglevel=pci:8,acpi:8,apic=12,dev:8 support v7
    ... fix some checkpatch error and warning ... expand msg_loglevel to 2 digi bits. ... not just one susbsys one tag, and don't need to update kernel.h to add more tags ...
    (Linux-Kernel)
  • Re: favicon, there ?
    ... Warning: inserting missing 'title' element ... > I have the favicon.ico in the root dir and this was the tag I had ... > <LINK REL="SHORTCUT ICON" ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Direct_IO and files of tagged types
    ... >> warning that the element type contains an access value. ... >> type referenced in the warning is to the tag mechanism. ... Without dispatching tags are just ...
    (comp.lang.ada)