aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-08-20 09:48:51 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-20 09:48:51 +0000
commit6cd8f5b09415ec799f797e5b521afd18552cd747 (patch)
tree73b01db9d46ba069cf32333cb74682a3952538c6 /gcc/function.c
parent98cbc7e489ced8092e110777c119751f245ad116 (diff)
downloadgcc-6cd8f5b09415ec799f797e5b521afd18552cd747.zip
gcc-6cd8f5b09415ec799f797e5b521afd18552cd747.tar.gz
gcc-6cd8f5b09415ec799f797e5b521afd18552cd747.tar.bz2
[Ada] Pragma Warning_As_Error works for style warnings
Pragma Warning_As_Error now works for style warnings (messages that start with "(style)", enabled by -gnaty) the same way it works for regular warnings enabled by -gnatw. The following test should fail to build with style checks: gnat.adc: pragma Warning_As_Error ("two spaces required"); style.adb: procedure Style is X : Integer; begin null; --Hello end; gnatmake -q -f -g style.adb -gnaty should get: style.adb:2:04: warning: variable "X" is never read and never assigned style.adb:5:06: error: (style) two spaces required [warning-as-error] style.adb:6:01: (style) "end Style" required gnatmake: "style.adb" compilation error and no executable should be created. 2019-08-20 Bob Duff <duff@adacore.com> gcc/ada/ * errout.adb (Error_Msg_Internal): Set Warn_Err in case of Is_Style_Msg. * erroutc.adb (Output_Msg_Text): Do Warnings_Treated_As_Errors processing and [warning-as-error] modification for style messages. Clean up code, simplify, remove unnecessary block statement, add renaming of table entry. * erroutc.ads (Warning_Treated_As_Error): Fix comment: no such thing as Set_Warning_As_Error. * opt.ads: Clean up comments and move related declarations near each other. * par-prag.adb: Process Warning_As_Error. This is necessary because many style warning happen during parsing. * sem_prag.adb: Use new Acquire_Warning_Match_String. * sem_util.ads, sem_util.adb (Acquire_Warning_Match_String): New function shared by par-prag.adb and sem_prag.adb. Replaces the procedure in sem_prag.adb. Avoid use of global variables. * stringt.ads, stringt.adb (To_String): New function to convert String_Id to String. * doc/gnat_rm/implementation_defined_pragmas.rst: Document the new feature. * gnat_rm.texi: Regenerate. From-SVN: r274721
Diffstat (limited to 'gcc/function.c')
0 files changed, 0 insertions, 0 deletions