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 error in classification of restriction warnings


Some restriction warnings messages were still being tagged as
[enabled by default] instead of [restriction warning]. The
following program used not to give the warning since it got
incorrectly suppressed (compiled with -gnatj55 -gnatw.d -gnatl)

     1. pragma Warnings (Off, "[enabled by default]");
     2. pragma Restriction_Warnings
     3.   (No_Dependence => Ada.Containers);
     4. with Ada.Containers;
             |
        >>> warning: violation of restriction
            "No_Dependence => Ada.Containers" at line
            3 [restriction warning]

     5. procedure Ololo (Unref : Integer) is
     6.     type String is (A, B, C);
     7.
     8.     procedure P (I, J : in out Integer) is
     9.     begin
    10.        if I < J then
    11.           I := I + 1;
    12.           P (I, J);
    13.        end if;
    14.     end P;
    15.
    16.     J, I  : Integer := 10;
    17.
    18.     X, Y : Float := 1.0;
    19. begin
    20.     if X = Y then
    21.        P (J, I);
    22.     end if;
    23. end;

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

2014-05-21  Robert Dewar  <dewar@adacore.com>

	* errout.ads: Add documentation for use of >*> tag.
	* restrict.adb: Make sure we use >*> tag for restriction warnings.

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]