You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a field value is used in calculations and the result is larger than the field the generated code will not compile but fail with a static constraint check.
package Test is
type Length_Type is mod 2 ** 8;
type Packet is
message
Length_1 : Length_Type;
Length_2 : Length_Type
then Payload
with Size => Length_2 * 256 + Length_1
if (Length_2 * 256 + Length_1) mod 8 = 0;
Payload : Opaque;
end message;
end Test;
This will lead to the following error on the generated code:
rflx-test-packet.adb:444:100: error: value not in range of type "Length_Type" defined at rflx-test.ads:16
rflx-test-packet.adb:444:100: error: static expression fails Constraint_Check
The text was updated successfully, but these errors were encountered:
When a field value is used in calculations and the result is larger than the field the generated code will not compile but fail with a static constraint check.
This will lead to the following error on the generated code:
The text was updated successfully, but these errors were encountered: