diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-16 14:21:34 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-16 14:21:34 +0000 |
commit | 86ef3bbb35335d2d1284e55e1ed4d164e102e7db (patch) | |
tree | fe660786a086e74af2669d5df532ded0131e633b /gcc/ada/gnat_rm.texi | |
parent | f69938188a9a01058c5d5f62d252fe4267a40832 (diff) | |
download | gcc-86ef3bbb35335d2d1284e55e1ed4d164e102e7db.tar.gz |
2014-07-16 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Document that leading/trailing asterisks are
now implied for the pattern match string for pragma Warnings
and Warning_As_Error.
* sem_prag.adb (Acquire_Warning_Match_String): New procedure.
(Analyze_Pragma, case Warning_As_Error): Call
Acquire_Warning_Match_String.
(Analyze_Pragma, case Warnings): Call Acquire_Warning_Match_String.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212651 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnat_rm.texi')
-rw-r--r-- | gcc/ada/gnat_rm.texi | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 6afacd2a348..166a6cce21d 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -7328,7 +7328,8 @@ pragma Unreferenced (library_unit_NAME @{, library_unit_NAME@}); @noindent This pragma signals that the entities whose names are listed are -deliberately not referenced in the current source unit. This +deliberately not referenced in the current source unit after the +occurrence of the pragma. This suppresses warnings about the entities being unreferenced, and in addition a warning will be generated if one of these entities is in fact subsequently referenced in the @@ -7576,12 +7577,16 @@ which treats all warnings as errors. The pattern may contain asterisks, which match zero or more characters in the message. For example, you can use -@code{pragma Warning_As_Error ("*bits of*unused")} to treat the warning +@code{pragma Warning_As_Error ("bits of*unused")} to treat the warning message @code{warning: 960 bits of "a" unused} as an error. No other regular expression notations are permitted. All characters other than asterisk in these three specific cases are treated as literal characters in the match. The match is case insensitive, for example XYZ matches xyz. +Note that the pattern matches if it occurs anywhere within the warning +message string (it is not necessary to put an asterisk at the start and +the end of the message, since this is implied). + Another possibility for the static_string_EXPRESSION which works whether or not error tags are enabled (@option{-gnatw.d}) is to use the @option{-gnatw} tag string, enclosed in brackets, @@ -7716,20 +7721,24 @@ warning messages (not including the initial "warning: " tag). The pattern may contain asterisks, which match zero or more characters in the message. For example, you can use -@code{pragma Warnings (Off, "*bits of*unused")} to suppress the warning +@code{pragma Warnings (Off, "bits of*unused")} to suppress the warning message @code{warning: 960 bits of "a" unused}. No other regular expression notations are permitted. All characters other than asterisk in these three specific cases are treated as literal characters in the match. The match is case insensitive, for example XYZ matches xyz. +Note that the pattern matches if it occurs anywhere within the warning +message string (it is not necessary to put an asterisk at the start and +the end of the message, since this is implied). + The above use of patterns to match the message applies only to warning messages generated by the front end. This form of the pragma with a string argument can also be used to control warnings provided by the back end and mentioned above. By using a single full @option{-Wxxx} switch in the pragma, such warnings can be turned on and off. -There are two ways to use the pragma in this form. The OFF form can be used as a -configuration pragma. The effect is to suppress all warnings (if any) +There are two ways to use the pragma in this form. The OFF form can be used +as a configuration pragma. The effect is to suppress all warnings (if any) that match the pattern string throughout the compilation (or match the -W switch in the back end case). |