comp.lang.ada
 help / color / mirror / Atom feed
* Unchecked_Union with empty variant
@ 2009-03-15 13:10 Ivan Levashew
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Levashew @ 2009-03-15 13:10 UTC (permalink / raw)


[Check_Unions.adb



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Unchecked_Union with empty variant
@ 2009-03-15 13:34 Ivan Levashew
  2009-03-16 15:16 ` Adam Beneschan
  2009-03-16 21:52 ` Stephen Leake
  0 siblings, 2 replies; 6+ messages in thread
From: Ivan Levashew @ 2009-03-15 13:34 UTC (permalink / raw)


[Check_Unions.adb]
~~~~~~~~
procedure Check_Unions is


type Complex_Record (Kind : Integer := 0) is record
    Constant_Part : Character;
    Constant_Part2 : Character;
    case Kind is
    when 0 =>
      Variant_Part1 : Character;
    when 1 =>
      Variant_Part2 : Character;
    when 2 =>
      Variant_Part3 : Character;
    when others =>
      null;
    end case;
end record;

pragma Unchecked_Union (Complex_Record);

begin
    null;
end Check_Unions;
~~~~~~~~

It gives an error:
C:\...ramming\GEMA-Win32API\Ada_test>gnatmake -gnat05 Check_Unions.adb
gcc -c -gnat05 check_unions.adb
check_unions.adb:14:04: Unchecked_Union may not have empty component list
gnatmake: "check_unions.adb" compilation error

What's the problem?

I can't see any words "empty" or "null" here:

http://www.adaic.com/standards/05aarm/html/AA-B-3-3.html

-- 
If you want to get to the top, you have to start at the bottom



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Unchecked_Union with empty variant
@ 2009-03-15 13:02 Ivan Levashew
  0 siblings, 0 replies; 6+ messages in thread
From: Ivan Levashew @ 2009-03-15 13:02 UTC (permalink / raw)


[Check_Unions.adb



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-03-17  7:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-15 13:10 Unchecked_Union with empty variant Ivan Levashew
  -- strict thread matches above, loose matches on Subject: below --
2009-03-15 13:34 Ivan Levashew
2009-03-16 15:16 ` Adam Beneschan
2009-03-16 21:52 ` Stephen Leake
2009-03-17  7:21   ` Ivan Levashew
2009-03-15 13:02 Ivan Levashew

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