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] Better error message for misused preprocessor directive


This patch causes the scanner to recognize preprocessor directives
in the case where the preprocessor is in active, and give better
messages, as shown by this example compiled with -gnatld7 -gnatj60.

     1. package Preproc is
     2. #if JUNK then
        |
        >>> preprocessor directive ignored, preprocessor
            not active

     3.    X : Integer;
     4. #elsif JUNK1 then
        |
        >>> preprocessor directive ignored, preprocessor
            not active

     5.    Y : Integer;
     6. #else
        |
        >>> preprocessor directive ignored, preprocessor
            not active

     7.    Z : Integer;
     8. #end if;
        |
        >>> preprocessor directive ignored, preprocessor
            not active

     9. end Preproc;

Tested on x86_64-pc-linux-gnu, committed on trunk

2012-03-19  Robert Dewar  <dewar@adacore.com>

	* scng.adb (Scan): Recognize incorrect preprocessor directive

Attachment: difs
Description: Text document


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