diff options
author | Bob Duff <duff@adacore.com> | 2019-08-20 09:49:02 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-20 09:49:02 +0000 |
commit | 94f76dc10cdbdfcd5255b0c0cf15ab9056c0c514 (patch) | |
tree | da58597813cb45bdeb79cc8caeb9e07beb493ab9 /gcc/ada/doc/gnat_ugn | |
parent | afdc759841f8f4f464f3d5a2ba8e05e9a8e41d72 (diff) | |
download | gcc-94f76dc10cdbdfcd5255b0c0cf15ab9056c0c514.zip gcc-94f76dc10cdbdfcd5255b0c0cf15ab9056c0c514.tar.gz gcc-94f76dc10cdbdfcd5255b0c0cf15ab9056c0c514.tar.bz2 |
[Ada] Warning for out-of-order record representation clauses
The compiler can now warn for out-of-order record representation
clauses. A warning is given if the order of component declarations,
component clauses, and bit-level layout do not all agree. The warning
is disabled by default, and may be enabled by the -gnatw_r switch.
2019-08-20 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch13.adb (Component_Order_Check): New procedure to check
for out-of-order clauses.
* warnsw.ads, warnsw.adb: New -gnatw_r switch.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Document new switch.
* gnat_ugn.texi: Regenerate.
From-SVN: r274723
Diffstat (limited to 'gcc/ada/doc/gnat_ugn')
-rw-r--r-- | gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 913d6b9..82aecc8 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -2760,7 +2760,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). :switch:`-gnatwa` *Activate most optional warnings.* - This switch activates most optional warning messages. See the remaining list + This switch activates most optional warning messages. See the remaining list in this section for details on optional warning messages that can be individually controlled. The warnings that are not turned on by this switch are: @@ -2790,6 +2790,8 @@ of the pragma in the :title:`GNAT_Reference_manual`). * :switch:`-gnatw.q` (questionable layout of record types) + * :switch:`-gnatw_r` (out-of-order record representation clauses) + * :switch:`-gnatw.s` (overridden size clause) * :switch:`-gnatwt` (tracking of deleted conditional code) @@ -3708,7 +3710,7 @@ of the pragma in the :title:`GNAT_Reference_manual`). warnings are given. -.. index:: -gnatwT (gcc) +.. index:: -gnatw.R (gcc) :switch:`-gnatw.R` *Suppress warnings for object renaming function.* @@ -3716,6 +3718,23 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch suppresses warnings for object renaming function. +.. index:: -gnatw_r (gcc) + +:switch:`-gnatw_r` + *Activate warnings for out-of-order record representation clauses.* + + This switch activates warnings for record representation clauses, + if the order of component declarations, component clauses, + and bit-level layout do not all agree. + The default is that these warnings are not given. + + +.. index:: -gnatw_R (gcc) + +:switch:`-gnatw_R` + *Suppress warnings for out-of-order record representation clauses.* + + .. index:: -gnatws (gcc) :switch:`-gnatws` |