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] Enhance error mesage handling for configuration file pragmas


Tested on x86-linux, committed on mainline.

The handling of bad pragmas in configuration files has been improved
in three respects. First, multiple errors are given if there are multiple
bad pragmas (previously, the scan stopped at the first bad pragma). Second,
the error flag is placed at the start of the offending pragma, rather than
right after it. Third, two separate messages are given to distinguish the
cases of unrecognized pragmas, and pragmas that are recoognized, but not
allowed as configuration pragmas. A test program is given in k.adb. If this
is compiled with -gnatl, the output should be something like:

Checking: k.adb (source file time stamp: 2004-12-25 16:40:06)

     1. procedure k is begin null; end;

==============Error messages for configuration pragmas file: gnat.adc
     2. pragma Restriction (No_Streams);
        |
        >>> unrecognized pragma in configuration file

     3. pragma Restriction (No_Streams);
        |
        >>> unrecognized pragma in configuration file

     5. pragma Page;
        |
        >>> only configuration pragmas allowed in configuration file

 1 line: 3 errors
--
procedure k is begin null; end;
-- gnat.adc:
pragma Restrictions (No_Streams);
pragma Restriction (No_Streams);
pragma Restriction (No_Streams);
pragma Restrictions (No_Streams);
pragma Page;

2005-01-03  Robert Dewar  <dewar@adacore.com>

	* par.adb: Enhance error message handling for configuration file
	pragmas.

Attachment: difs.19
Description: Text document


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