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] pragma Warnings (Off) disabled if warning treated as error


The filtering of warnings set by pragma Warnings (Off) may be disabled if an
unfiltered warning is issued by the compiler and this warning is treated as
an error, e.g. by means of -gnatwe.

This behavior clearly goes against the Principle of Least Surprise and is
therefore changed.  The following package must be compiled with the same
single warning about the value not in range, with or without -gnatwe:

with Ada.Unchecked_Conversion;

package P is

  pragma Warnings (Off,"types for unchecked conversion have different sizes");

  function F is new Ada.Unchecked_Conversion (Character, Integer);

  A : Positive := -1;

end P;

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

2017-11-09  Eric Botcazou  <ebotcazou@adacore.com>

	* gnat1drv.adb (Gnat1drv): Call Errout.Finalize (Last_Call => True)
	before Errout.Output_Messages also in the case of compilation errors.

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]