comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: What shoudl GNAT do wrt variant record and representation clauses?
Date: Mon, 02 Feb 2015 09:04:27 +0000
Date: 2015-02-02T09:04:27+00:00	[thread overview]
Message-ID: <ly8uggofac.fsf@pushface.org> (raw)
In-Reply-To: 49494faf-1e2d-43a1-a2b0-fd25af3850cc@googlegroups.com

Lucretia <laguest9000@googlemail.com> writes:

>    for Pixel_Orders use
>       record
>          Indexed_Order at 0 range 0 .. 2;
>          Packed_Order  at 0 range 0 .. 3;
>          Array_Order   at 0 range 0 .. 3;
>       end record;

Pretty sure you're saying that you don't care what the top bit of the
4-bit field is if it contains an Indexed_Order. So sometimes it'll be
wrong.

I must say, since you're setting up constants, I'd have expected the
compiler to work out the required 32-bit Pixel_Format_Names value at
compile time from a zeroed base!

I wondered whether -gnatw.h would do the trick, but (4.9.1) it just says

gcc -c -gnatw.h pixel_formats.ads
pixel_formats.ads:124:10: warning: 32768-bit gap before component "Indexed_Order"
pixel_formats.ads:125:10: warning: 32768-bit gap before component "Packed_Order"
pixel_formats.ads:126:10: warning: 32768-bit gap before component "Array_Order"

:-)

(I changed the name of the package to save trouble downloading other stuff)


  parent reply	other threads:[~2015-02-02  9:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  1:29 What shoudl GNAT do wrt variant record and representation clauses? Lucretia
2015-02-02  7:45 ` jsquirek
2015-02-02  7:55   ` Lucretia
2015-02-02  9:04 ` Simon Wright [this message]
2015-02-04  9:59 ` Stephen Leake
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox