Bob Duff 0246fe44ac [Ada] Warn about unknown condition in Compile_Time_Warning
The compiler now warns if the condition in a pragma Compile_Time_Warning
or Compile_Time_Error does not have a compile-time-known value. The
warning is not given for pragmas in a generic template, but is given for
pragmas in an instance.

The -gnatw_c and -gnatw_C switches turn the warning on and off. The
default is on.

2019-08-14  Bob Duff  <duff@adacore.com>

gcc/ada/

	* sem_prag.ads, sem_prag.adb
	(Process_Compile_Time_Warning_Or_Error): In parameterless
	version, improve detection of whether we are in a generic unit
	to cover the case of an instance within a generic unit.
	(Process_Compile_Time_Warning_Or_Error): Rename the
	two-parameter version to be
	Validate_Compile_Time_Warning_Or_Error, and do not export it.
	Issue a warning if the condition is not known at compile time.
	The key point is that the warning must be given only for pragmas
	deferred to the back end, because the back end discovers
	additional values that are known at compile time.  Previous
	changes in this ticket have enabled this by deferring to the
	back end without checking for special cases such as 'Size.
	(Validate_Compile_Time_Warning_Or_Error): Rename to be
	Defer_Compile_Time_Warning_Error_To_BE.
	* warnsw.ads, warnsw.adb (Warn_On_Unknown_Compile_Time_Warning):
	Add new switches -gnatw_c and -gnatw_C to control the above
	warning.
	* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
	Document new switches.
	* gnat_ugn.texi: Regenerate.

gcc/testsuite/

	* gnat.dg/warn27.adb: New testcase.

From-SVN: r274469
2019-08-14 09:52:34 +00:00
2019-08-13 17:17:49 +02:00
2019-08-09 23:02:08 +01:00
2019-07-15 21:17:16 +00:00
2019-08-14 08:50:24 +00:00
2019-08-13 13:38:17 +00:00
2019-08-13 13:38:17 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 3.1 GiB
Languages
C 48%
Ada 18.3%
C++ 14.1%
Go 7%
GCC Machine Description 4.6%
Other 7.7%