1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2005, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 2, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING. If not, write --
19 -- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
20 -- Boston, MA 02110-1301, USA. --
22 -- GNAT was originally developed by the GNAT team at New York University. --
23 -- Extensive contributions were provided by Ada Core Technologies Inc. --
25 ------------------------------------------------------------------------------
27 -- Warning! Error messages can be generated during Gigi processing by direct
28 -- calls to error message routines, so it is essential that the processing
29 -- in this body be consistent with the requirements for the Gigi processing
30 -- environment, and that in particular, no disallowed table expansion is
33 with Casing
; use Casing
;
34 with Debug
; use Debug
;
35 with Err_Vars
; use Err_Vars
;
36 with Namet
; use Namet
;
38 with Output
; use Output
;
39 with Sinput
; use Sinput
;
40 with Snames
; use Snames
;
41 with Targparm
; use Targparm
;
43 with Uintp
; use Uintp
;
45 package body Erroutc
is
47 -----------------------
48 -- Local Subprograms --
49 -----------------------
55 procedure Add_Class
is
60 Get_Name_String
(Name_Class
);
61 Set_Casing
(Identifier_Casing
(Flag_Source
), Mixed_Case
);
66 ----------------------
67 -- Buffer_Ends_With --
68 ----------------------
70 function Buffer_Ends_With
(S
: String) return Boolean is
71 Len
: constant Natural := S
'Length;
75 and then Msg_Buffer
(Msglen
- Len
) = ' '
76 and then Msg_Buffer
(Msglen
- Len
+ 1 .. Msglen
) = S
;
83 procedure Buffer_Remove
(S
: String) is
85 if Buffer_Ends_With
(S
) then
86 Msglen
:= Msglen
- S
'Length;
90 -----------------------------
91 -- Check_Duplicate_Message --
92 -----------------------------
94 procedure Check_Duplicate_Message
(M1
, M2
: Error_Msg_Id
) is
95 L1
, L2
: Error_Msg_Id
;
96 N1
, N2
: Error_Msg_Id
;
98 procedure Delete_Msg
(Delete
, Keep
: Error_Msg_Id
);
99 -- Called to delete message Delete, keeping message Keep. Marks
100 -- all messages of Delete with deleted flag set to True, and also
101 -- makes sure that for the error messages that are retained the
102 -- preferred message is the one retained (we prefer the shorter
103 -- one in the case where one has an Instance tag). Note that we
104 -- always know that Keep has at least as many continuations as
105 -- Delete (since we always delete the shorter sequence).
111 procedure Delete_Msg
(Delete
, Keep
: Error_Msg_Id
) is
119 Errors
.Table
(D
).Deleted
:= True;
121 -- Adjust error message count
123 if Errors
.Table
(D
).Warn
or Errors
.Table
(D
).Style
then
124 Warnings_Detected
:= Warnings_Detected
- 1;
126 Total_Errors_Detected
:= Total_Errors_Detected
- 1;
128 if Errors
.Table
(D
).Serious
then
129 Serious_Errors_Detected
:= Serious_Errors_Detected
- 1;
133 -- Substitute shorter of the two error messages
135 if Errors
.Table
(K
).Text
'Length > Errors
.Table
(D
).Text
'Length then
136 Errors
.Table
(K
).Text
:= Errors
.Table
(D
).Text
;
139 D
:= Errors
.Table
(D
).Next
;
140 K
:= Errors
.Table
(K
).Next
;
142 if D
= No_Error_Msg
or else not Errors
.Table
(D
).Msg_Cont
then
148 -- Start of processing for Check_Duplicate_Message
151 -- Both messages must be non-continuation messages and not deleted
153 if Errors
.Table
(M1
).Msg_Cont
154 or else Errors
.Table
(M2
).Msg_Cont
155 or else Errors
.Table
(M1
).Deleted
156 or else Errors
.Table
(M2
).Deleted
161 -- Definitely not equal if message text does not match
163 if not Same_Error
(M1
, M2
) then
167 -- Same text. See if all continuations are also identical
173 N1
:= Errors
.Table
(L1
).Next
;
174 N2
:= Errors
.Table
(L2
).Next
;
176 -- If M1 continuations have run out, we delete M1, either the
177 -- messages have the same number of continuations, or M2 has
178 -- more and we prefer the one with more anyway.
180 if N1
= No_Error_Msg
or else not Errors
.Table
(N1
).Msg_Cont
then
184 -- If M2 continuatins have run out, we delete M2
186 elsif N2
= No_Error_Msg
or else not Errors
.Table
(N2
).Msg_Cont
then
190 -- Otherwise see if continuations are the same, if not, keep both
191 -- sequences, a curious case, but better to keep everything!
193 elsif not Same_Error
(N1
, N2
) then
196 -- If continuations are the same, continue scan
203 end Check_Duplicate_Message
;
205 ------------------------
206 -- Compilation_Errors --
207 ------------------------
209 function Compilation_Errors
return Boolean is
211 return Total_Errors_Detected
/= 0
212 or else (Warnings_Detected
/= 0
213 and then Warning_Mode
= Treat_As_Error
);
214 end Compilation_Errors
;
220 procedure Debug_Output
(N
: Node_Id
) is
223 Write_Str
("*** following error message posted on node id = #");
234 procedure dmsg
(Id
: Error_Msg_Id
) is
235 E
: Error_Msg_Object
renames Errors
.Table
(Id
);
238 w
("Dumping error message, Id = ", Int
(Id
));
239 w
(" Text = ", E
.Text
.all);
240 w
(" Next = ", Int
(E
.Next
));
241 w
(" Sfile = ", Int
(E
.Sfile
));
245 Write_Location
(E
.Sptr
);
250 Write_Location
(E
.Optr
);
253 w
(" Line = ", Int
(E
.Line
));
254 w
(" Col = ", Int
(E
.Col
));
255 w
(" Warn = ", E
.Warn
);
256 w
(" Style = ", E
.Style
);
257 w
(" Serious = ", E
.Serious
);
258 w
(" Uncond = ", E
.Uncond
);
259 w
(" Msg_Cont = ", E
.Msg_Cont
);
260 w
(" Deleted = ", E
.Deleted
);
269 function Get_Location
(E
: Error_Msg_Id
) return Source_Ptr
is
271 return Errors
.Table
(E
).Sptr
;
278 function Get_Msg_Id
return Error_Msg_Id
is
283 -----------------------
284 -- Output_Error_Msgs --
285 -----------------------
287 procedure Output_Error_Msgs
(E
: in out Error_Msg_Id
) is
293 Mult_Flags
: Boolean := False;
298 -- Skip deleted messages at start
300 if Errors
.Table
(S
).Deleted
then
301 Set_Next_Non_Deleted_Msg
(S
);
304 -- Figure out if we will place more than one error flag on this line
307 while T
/= No_Error_Msg
308 and then Errors
.Table
(T
).Line
= Errors
.Table
(E
).Line
309 and then Errors
.Table
(T
).Sfile
= Errors
.Table
(E
).Sfile
311 if Errors
.Table
(T
).Sptr
> Errors
.Table
(E
).Sptr
then
315 Set_Next_Non_Deleted_Msg
(T
);
318 -- Output the error flags. The circuit here makes sure that the tab
319 -- characters in the original line are properly accounted for. The
320 -- eight blanks at the start are to match the line number.
322 if not Debug_Flag_2
then
324 P
:= Line_Start
(Errors
.Table
(E
).Sptr
);
327 -- Loop through error messages for this line to place flags
330 while T
/= No_Error_Msg
331 and then Errors
.Table
(T
).Line
= Errors
.Table
(E
).Line
332 and then Errors
.Table
(T
).Sfile
= Errors
.Table
(E
).Sfile
334 -- Loop to output blanks till current flag position
336 while P
< Errors
.Table
(T
).Sptr
loop
337 if Source_Text
(Errors
.Table
(T
).Sfile
) (P
) = ASCII
.HT
then
338 Write_Char
(ASCII
.HT
);
346 -- Output flag (unless already output, this happens if more
347 -- than one error message occurs at the same flag position).
349 if P
= Errors
.Table
(T
).Sptr
then
350 if (Flag_Num
= 1 and then not Mult_Flags
)
355 Write_Char
(Character'Val (Character'Pos ('0') + Flag_Num
));
361 Set_Next_Non_Deleted_Msg
(T
);
362 Flag_Num
:= Flag_Num
+ 1;
368 -- Now output the error messages
371 while T
/= No_Error_Msg
372 and then Errors
.Table
(T
).Line
= Errors
.Table
(E
).Line
373 and then Errors
.Table
(T
).Sfile
= Errors
.Table
(E
).Sfile
380 while Column
< 74 loop
388 Set_Next_Non_Deleted_Msg
(T
);
392 end Output_Error_Msgs
;
394 ------------------------
395 -- Output_Line_Number --
396 ------------------------
398 procedure Output_Line_Number
(L
: Logical_Line_Number
) is
399 D
: Int
; -- next digit
400 C
: Character; -- next character
401 Z
: Boolean; -- flag for zero suppress
402 N
, M
: Int
; -- temporaries
405 if L
= No_Line_Number
then
426 C
:= Character'Val (D
+ 48);
434 end Output_Line_Number
;
436 ---------------------
437 -- Output_Msg_Text --
438 ---------------------
440 procedure Output_Msg_Text
(E
: Error_Msg_Id
) is
442 if Errors
.Table
(E
).Warn
then
443 Write_Str
("warning: ");
445 elsif Errors
.Table
(E
).Style
then
448 elsif Opt
.Unique_Error_Tag
then
449 Write_Str
("error: ");
452 Write_Str
(Errors
.Table
(E
).Text
.all);
459 procedure Purge_Messages
(From
: Source_Ptr
; To
: Source_Ptr
) is
462 function To_Be_Purged
(E
: Error_Msg_Id
) return Boolean;
463 -- Returns True for a message that is to be purged. Also adjusts
464 -- error counts appropriately.
470 function To_Be_Purged
(E
: Error_Msg_Id
) return Boolean is
473 and then Errors
.Table
(E
).Sptr
> From
474 and then Errors
.Table
(E
).Sptr
< To
476 if Errors
.Table
(E
).Warn
or Errors
.Table
(E
).Style
then
477 Warnings_Detected
:= Warnings_Detected
- 1;
479 Total_Errors_Detected
:= Total_Errors_Detected
- 1;
481 if Errors
.Table
(E
).Serious
then
482 Serious_Errors_Detected
:= Serious_Errors_Detected
- 1;
493 -- Start of processing for Purge_Messages
496 while To_Be_Purged
(First_Error_Msg
) loop
497 First_Error_Msg
:= Errors
.Table
(First_Error_Msg
).Next
;
500 E
:= First_Error_Msg
;
501 while E
/= No_Error_Msg
loop
502 while To_Be_Purged
(Errors
.Table
(E
).Next
) loop
503 Errors
.Table
(E
).Next
:=
504 Errors
.Table
(Errors
.Table
(E
).Next
).Next
;
507 E
:= Errors
.Table
(E
).Next
;
515 function Same_Error
(M1
, M2
: Error_Msg_Id
) return Boolean is
516 Msg1
: constant String_Ptr
:= Errors
.Table
(M1
).Text
;
517 Msg2
: constant String_Ptr
:= Errors
.Table
(M2
).Text
;
519 Msg2_Len
: constant Integer := Msg2
'Length;
520 Msg1_Len
: constant Integer := Msg1
'Length;
526 (Msg1_Len
- 10 > Msg2_Len
528 Msg2
.all = Msg1
.all (1 .. Msg2_Len
)
530 Msg1
(Msg2_Len
+ 1 .. Msg2_Len
+ 10) = ", instance")
532 (Msg2_Len
- 10 > Msg1_Len
534 Msg1
.all = Msg2
.all (1 .. Msg1_Len
)
536 Msg2
(Msg1_Len
+ 1 .. Msg1_Len
+ 10) = ", instance");
543 procedure Set_Msg_Blank
is
546 and then Msg_Buffer
(Msglen
) /= ' '
547 and then Msg_Buffer
(Msglen
) /= '('
548 and then not Manual_Quote_Mode
554 -------------------------------
555 -- Set_Msg_Blank_Conditional --
556 -------------------------------
558 procedure Set_Msg_Blank_Conditional
is
561 and then Msg_Buffer
(Msglen
) /= ' '
562 and then Msg_Buffer
(Msglen
) /= '('
563 and then Msg_Buffer
(Msglen
) /= '"'
564 and then not Manual_Quote_Mode
568 end Set_Msg_Blank_Conditional
;
574 procedure Set_Msg_Char
(C
: Character) is
577 -- The check for message buffer overflow is needed to deal with cases
578 -- where insertions get too long (in particular a child unit name can
581 if Msglen
< Max_Msg_Length
then
582 Msglen
:= Msglen
+ 1;
583 Msg_Buffer
(Msglen
) := C
;
587 ---------------------------------
588 -- Set_Msg_Insertion_File_Name --
589 ---------------------------------
591 procedure Set_Msg_Insertion_File_Name
is
593 if Error_Msg_Name_1
= No_Name
then
596 elsif Error_Msg_Name_1
= Error_Name
then
598 Set_Msg_Str
("<error>");
602 Get_Name_String
(Error_Msg_Name_1
);
608 -- The following assignments ensure that the second and third percent
609 -- insertion characters will correspond to the Error_Msg_Name_2 and
610 -- Error_Msg_Name_3 as required.
612 Error_Msg_Name_1
:= Error_Msg_Name_2
;
613 Error_Msg_Name_2
:= Error_Msg_Name_3
;
614 end Set_Msg_Insertion_File_Name
;
616 -----------------------------------
617 -- Set_Msg_Insertion_Line_Number --
618 -----------------------------------
620 procedure Set_Msg_Insertion_Line_Number
(Loc
, Flag
: Source_Ptr
) is
621 Sindex_Loc
: Source_File_Index
;
622 Sindex_Flag
: Source_File_Index
;
627 if Loc
= No_Location
then
628 Set_Msg_Str
("at unknown location");
630 elsif Loc
= System_Location
then
631 Set_Msg_Str
("in package System");
632 Set_Msg_Insertion_Run_Time_Name
;
634 elsif Loc
= Standard_Location
then
635 Set_Msg_Str
("in package Standard");
637 elsif Loc
= Standard_ASCII_Location
then
638 Set_Msg_Str
("in package Standard.ASCII");
641 -- Add "at file-name:" if reference is to other than the source
642 -- file in which the error message is placed. Note that we check
643 -- full file names, rather than just the source indexes, to
644 -- deal with generic instantiations from the current file.
646 Sindex_Loc
:= Get_Source_File_Index
(Loc
);
647 Sindex_Flag
:= Get_Source_File_Index
(Flag
);
649 if Full_File_Name
(Sindex_Loc
) /= Full_File_Name
(Sindex_Flag
) then
652 (Reference_Name
(Get_Source_File_Index
(Loc
)));
656 -- If in current file, add text "at line "
659 Set_Msg_Str
("at line ");
662 -- Output line number for reference
664 Set_Msg_Int
(Int
(Get_Logical_Line_Number
(Loc
)));
666 -- Deal with the instantiation case. We may have a reference to,
667 -- e.g. a type, that is declared within a generic template, and
668 -- what we are really referring to is the occurrence in an instance.
669 -- In this case, the line number of the instantiation is also of
670 -- interest, and we add a notation:
674 -- where xxx is a line number output using this same routine (and
675 -- the recursion can go further if the instantiation is itself in
676 -- a generic template).
678 -- The flag location passed to us in this situation is indeed the
679 -- line number within the template, but as described in Sinput.L
680 -- (file sinput-l.ads, section "Handling Generic Instantiations")
681 -- we can retrieve the location of the instantiation itself from
682 -- this flag location value.
684 -- Note: this processing is suppressed if Suppress_Instance_Location
685 -- is set True. This is used to prevent redundant annotations of the
686 -- location of the instantiation in the case where we are placing
687 -- the messages on the instantiation in any case.
689 if Instantiation
(Sindex_Loc
) /= No_Location
690 and then not Suppress_Instance_Location
692 Set_Msg_Str
(", instance ");
693 Set_Msg_Insertion_Line_Number
(Instantiation
(Sindex_Loc
), Flag
);
696 end Set_Msg_Insertion_Line_Number
;
698 ----------------------------
699 -- Set_Msg_Insertion_Name --
700 ----------------------------
702 procedure Set_Msg_Insertion_Name
is
704 if Error_Msg_Name_1
= No_Name
then
707 elsif Error_Msg_Name_1
= Error_Name
then
709 Set_Msg_Str
("<error>");
712 Set_Msg_Blank_Conditional
;
713 Get_Unqualified_Decoded_Name_String
(Error_Msg_Name_1
);
715 -- Remove %s or %b at end. These come from unit names. If the
716 -- caller wanted the (unit) or (body), then they would have used
717 -- the $ insertion character. Certainly no error message should
718 -- ever have %b or %s explicitly occurring.
721 and then Name_Buffer
(Name_Len
- 1) = '%'
722 and then (Name_Buffer
(Name_Len
) = 'b'
724 Name_Buffer
(Name_Len
) = 's')
726 Name_Len
:= Name_Len
- 2;
729 -- Remove upper case letter at end, again, we should not be getting
730 -- such names, and what we hope is that the remainder makes sense.
733 and then Name_Buffer
(Name_Len
) in 'A' .. 'Z'
735 Name_Len
:= Name_Len
- 1;
738 -- If operator name or character literal name, just print it as is
739 -- Also print as is if it ends in a right paren (case of x'val(nnn))
741 if Name_Buffer
(1) = '"'
742 or else Name_Buffer
(1) = '''
743 or else Name_Buffer
(Name_Len
) = ')'
747 -- Else output with surrounding quotes in proper casing mode
750 Set_Casing
(Identifier_Casing
(Flag_Source
), Mixed_Case
);
757 -- The following assignments ensure that the second and third percent
758 -- insertion characters will correspond to the Error_Msg_Name_2 and
759 -- Error_Msg_Name_3 as required.
761 Error_Msg_Name_1
:= Error_Msg_Name_2
;
762 Error_Msg_Name_2
:= Error_Msg_Name_3
;
763 end Set_Msg_Insertion_Name
;
765 -------------------------------------
766 -- Set_Msg_Insertion_Reserved_Name --
767 -------------------------------------
769 procedure Set_Msg_Insertion_Reserved_Name
is
771 Set_Msg_Blank_Conditional
;
772 Get_Name_String
(Error_Msg_Name_1
);
774 Set_Casing
(Keyword_Casing
(Flag_Source
), All_Lower_Case
);
777 end Set_Msg_Insertion_Reserved_Name
;
779 -------------------------------------
780 -- Set_Msg_Insertion_Reserved_Word --
781 -------------------------------------
783 procedure Set_Msg_Insertion_Reserved_Word
788 Set_Msg_Blank_Conditional
;
791 while J
<= Text
'Last and then Text
(J
) in 'A' .. 'Z' loop
792 Name_Len
:= Name_Len
+ 1;
793 Name_Buffer
(Name_Len
) := Text
(J
);
797 Set_Casing
(Keyword_Casing
(Flag_Source
), All_Lower_Case
);
801 end Set_Msg_Insertion_Reserved_Word
;
803 -------------------------------------
804 -- Set_Msg_Insertion_Run_Time_Name --
805 -------------------------------------
807 procedure Set_Msg_Insertion_Run_Time_Name
is
809 if Targparm
.Run_Time_Name_On_Target
/= No_Name
then
810 Set_Msg_Blank_Conditional
;
812 Get_Name_String
(Targparm
.Run_Time_Name_On_Target
);
813 Set_Casing
(Mixed_Case
);
814 Set_Msg_Str
(Name_Buffer
(1 .. Name_Len
));
817 end Set_Msg_Insertion_Run_Time_Name
;
819 ----------------------------
820 -- Set_Msg_Insertion_Uint --
821 ----------------------------
823 procedure Set_Msg_Insertion_Uint
is
826 UI_Image
(Error_Msg_Uint_1
);
828 for J
in 1 .. UI_Image_Length
loop
829 Set_Msg_Char
(UI_Image_Buffer
(J
));
832 -- The following assignment ensures that a second carret insertion
833 -- character will correspond to the Error_Msg_Uint_2 parameter.
835 Error_Msg_Uint_1
:= Error_Msg_Uint_2
;
836 end Set_Msg_Insertion_Uint
;
842 procedure Set_Msg_Int
(Line
: Int
) is
845 Set_Msg_Int
(Line
/ 10);
848 Set_Msg_Char
(Character'Val (Character'Pos ('0') + (Line
rem 10)));
851 -------------------------
852 -- Set_Msg_Name_Buffer --
853 -------------------------
855 procedure Set_Msg_Name_Buffer
is
857 for J
in 1 .. Name_Len
loop
858 Set_Msg_Char
(Name_Buffer
(J
));
860 end Set_Msg_Name_Buffer
;
866 procedure Set_Msg_Quote
is
868 if not Manual_Quote_Mode
then
877 procedure Set_Msg_Str
(Text
: String) is
879 for J
in Text
'Range loop
880 Set_Msg_Char
(Text
(J
));
884 ------------------------------
885 -- Set_Next_Non_Deleted_Msg --
886 ------------------------------
888 procedure Set_Next_Non_Deleted_Msg
(E
: in out Error_Msg_Id
) is
890 if E
= No_Error_Msg
then
895 E
:= Errors
.Table
(E
).Next
;
896 exit when E
= No_Error_Msg
or else not Errors
.Table
(E
).Deleted
;
899 end Set_Next_Non_Deleted_Msg
;
901 ---------------------------
902 -- Set_Warnings_Mode_Off --
903 ---------------------------
905 procedure Set_Warnings_Mode_Off
(Loc
: Source_Ptr
) is
907 -- Don't bother with entries from instantiation copies, since we
908 -- will already have a copy in the template, which is what matters
910 if Instantiation
(Get_Source_File_Index
(Loc
)) /= No_Location
then
914 -- If last entry in table already covers us, this is a redundant
915 -- pragma Warnings (Off) and can be ignored. This also handles the
916 -- case where all warnings are suppressed by command line switch.
918 if Warnings
.Last
>= Warnings
.First
919 and then Warnings
.Table
(Warnings
.Last
).Start
<= Loc
920 and then Loc
<= Warnings
.Table
(Warnings
.Last
).Stop
924 -- Otherwise establish a new entry, extending from the location of
925 -- the pragma to the end of the current source file. This ending
926 -- point will be adjusted by a subsequent pragma Warnings (On).
929 Warnings
.Increment_Last
;
930 Warnings
.Table
(Warnings
.Last
).Start
:= Loc
;
931 Warnings
.Table
(Warnings
.Last
).Stop
:=
932 Source_Last
(Current_Source_File
);
934 end Set_Warnings_Mode_Off
;
936 --------------------------
937 -- Set_Warnings_Mode_On --
938 --------------------------
940 procedure Set_Warnings_Mode_On
(Loc
: Source_Ptr
) is
942 -- Don't bother with entries from instantiation copies, since we
943 -- will already have a copy in the template, which is what matters
945 if Instantiation
(Get_Source_File_Index
(Loc
)) /= No_Location
then
949 -- Nothing to do unless command line switch to suppress all warnings
950 -- is off, and the last entry in the warnings table covers this
951 -- pragma Warnings (On), in which case adjust the end point.
953 if (Warnings
.Last
>= Warnings
.First
954 and then Warnings
.Table
(Warnings
.Last
).Start
<= Loc
955 and then Loc
<= Warnings
.Table
(Warnings
.Last
).Stop
)
956 and then Warning_Mode
/= Suppress
958 Warnings
.Table
(Warnings
.Last
).Stop
:= Loc
;
960 end Set_Warnings_Mode_On
;
962 ------------------------------------
963 -- Test_Style_Warning_Serious_Msg --
964 ------------------------------------
966 procedure Test_Style_Warning_Serious_Msg
(Msg
: String) is
968 if Msg
(Msg
'First) = '\' then
972 Is_Serious_Error
:= True;
973 Is_Warning_Msg
:= False;
977 and then Msg
(Msg
'First .. Msg
'First + 6) = "(style)");
979 for J
in Msg
'Range loop
981 and then (J
= Msg
'First or else Msg
(J
- 1) /= ''')
983 Is_Warning_Msg
:= True;
986 and then (J
= Msg
'First or else Msg
(J
- 1) /= ''')
988 Is_Warning_Msg
:= Error_Msg_Warn
;
991 and then (J
= Msg
'First or else Msg
(J
- 1) /= ''')
993 Is_Serious_Error
:= False;
997 if Is_Warning_Msg
or else Is_Style_Msg
then
998 Is_Serious_Error
:= False;
1000 end Test_Style_Warning_Serious_Msg
;
1002 -------------------------
1003 -- Warnings_Suppressed --
1004 -------------------------
1006 function Warnings_Suppressed
(Loc
: Source_Ptr
) return Boolean is
1008 for J
in Warnings
.First
.. Warnings
.Last
loop
1009 if Warnings
.Table
(J
).Start
<= Loc
1010 and then Loc
<= Warnings
.Table
(J
).Stop
1017 end Warnings_Suppressed
;