]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix error message for Stream_Size
authorRonan Desplanques <desplanques@adacore.com>
Wed, 3 Sep 2025 09:02:53 +0000 (11:02 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 16 Sep 2025 08:18:51 +0000 (10:18 +0200)
commitdf2538ea7674bb5e8fa299745c6091e83e3b054d
tree6d5ee9b15d129989138b1ff0efc5aa5dc881b662
parentbc4d53dadb481f1b307e4b10e7dc3d7d3c11b3ee
ada: Fix error message for Stream_Size

Before this patch, confirming Stream_Size aspect specifications on
elementary types were incorrectly rejected when the stream size was 128,
and the error messages emitted for Stream_Size aspect errors gave
incorrect possible values.

This patch fixes this. The most significant part of the fix is a new
subprogram in Exp_Strm, Get_Primitives, that makes it possible to
retrieve a precise list of supported stream sizes, but also to select
the right runtime streaming primitives for a given type. Using the
latter, this patch factorizes code that was present in both
Build_Elementary_Input_Call and Build_Elementary_Write_Call.

gcc/ada/ChangeLog:

* exp_strm.ads (Get_Primitives): New function.
* exp_strm.adb (Get_Primitives): Likewise.
(Build_Elementary_Input_Call, Build_Elementary_Write_Call): use
Get_Primitives.
(Has_Stream_Standard_Rep): Add formal parameter and rename to...
(Is_Stream_Standard_Rep): New function.
* sem_ch13.adb (Analyze_Attribute_Definition_Clause): Fix error
emission.
gcc/ada/exp_strm.adb
gcc/ada/exp_strm.ads
gcc/ada/sem_ch13.adb