Forcing Ada to use minimum spec size for enumerated types with gnat 4.4 -


i have enumerated type needs 4 bits when declare variable of type compiler assigns variable 8 bits.

below simplified version of code.

subtype ab_range_index word range 0..3; type ab_buffer_type array(ab_range_index) of bit;  type buffer record    ...    var1        : some_buffer_type;    orig_ab_var : ab_buffer_type;     ... end record; buffer use record   ...   var1         @ 16 range 0..5;   orig_ab_var  @ 16 range 6..9;   ... end record; ... type ab_type (a,b); ab_type use (a => 0, b => 5); ab_type'size use 4; ... procedure proc(ab_buff : ab_buffer_type)  ab_var : ab_type;                      -- ab_var'size returns 8 in debugger. ab_var use @ ab_buff'address; begin    data_valid = ab_var'valid;          -- returns false since variable                                         -- contains bits    ...      

this worked under previous gnat versions not under gnat 4.4.6. understand gnat in compliance ada spec.

is there way force compiler make ab_var in above example 4 bits? i've tried 'object_size needs multiple of 8 bits.

i don't know of modern computer hardware can allocate 4 bits variable. minimum 8-bit byte.

and no offense, i'm skeptical previous version of gnat have been able either.

now within record has associated rep spec or suitable convention pragma, individual field of type ab_type allocated 4 bits.

but not discrete variable.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -