This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix misleading error message on bad size


Tested on i686-linux, committed on trunk

The error message for the case of a bad size for an object was
misleading in some cases. This patch fixes the error message to
be clearer (and includes a minor patch to erroutc.adb that makes
it easier to generate the required message).

A test program is:

     1. procedure Main is
     2.    MyIntVar : Integer;
     3.    for MyIntVar'Size use 128;
           |
        >>> size for primitive object must
            be a power of 2 in the range 8-64

     4. begin
     5.    MyIntVar := 123;
     6. end;

2006-02-13  Robert Dewar  <dewar@adacore.com>

	* erroutc.ads, erroutc.adb (Set_Message_Blank): Don't insert space
	after hyphen (small aesthetic change useful for a range of numbers
	using ^-^.
	Suppress range checks for a couple of assignments which otherwise
	cause validity checks with validity checking turned on.

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Size):
	Improvement in error message for object.
	(Rep_Item_Too_Late): Remove '!' in warning message.

Attachment: difs.29
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]