diff options
author | Viljar Indus <indus@adacore.com> | 2024-08-01 15:59:00 +0300 |
---|---|---|
committer | Marc Poulhiès <dkm@gcc.gnu.org> | 2024-08-23 10:51:04 +0200 |
commit | dce0d46490cc3f929a5636902f47e2410719e33c (patch) | |
tree | 17235f1c2a58a26d5f237dcd586bb23b525695d6 /gcc/ada/doc/gnat_ugn | |
parent | 92a9b5527b21b7af8aaaa3cea8553d9b3224f29a (diff) | |
download | gcc-dce0d46490cc3f929a5636902f47e2410719e33c.zip gcc-dce0d46490cc3f929a5636902f47e2410719e33c.tar.gz gcc-dce0d46490cc3f929a5636902f47e2410719e33c.tar.bz2 |
ada: Emit a warning on inheritly limited types
Record types that do not have a limited keyword but have a
member with a limited type are also considered to be limited types.
This can be confusing to understand for newer Ada users. It is
better to emit a warning in this scenario and suggest that the
type should be marked with a limited keyword. This diagnostic will
be acticated when the -gnatw_l switch is used.
gcc/ada/
* sem_ch3.adb: Add method Check_Inherited_Limted_Record for
emitting the warning for an inherited limited type.
* warnsw.adb: Add processing for the -gnatw_l switch that
triggeres the inheritly limited type warning.
* warnsw.ads: same as above.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Add
entry for -gnatw_l switch.
* gnat_ugn.texi: Regenerate.
Diffstat (limited to 'gcc/ada/doc/gnat_ugn')
-rw-r--r-- | gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst | 17 |
1 files changed, 17 insertions, 0 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 ce3ed0c..07ca2ea 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 @@ -3430,6 +3430,23 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch suppresses listing of inherited aspects. +.. index:: -gnatw_l (gcc) + +:switch:`-gnatw_l` + *Activate warnings on inheritely limited types.* + + This switch causes the compiler trigger warnings on record types that do not + have a limited keyword but contain a component that is a limited type. + + +.. index:: -gnatw_L (gcc) + +:switch:`-gnatw_L` + *Suppress warnings on inheritely limited types.* + + This switch suppresses warnings on inheritely limited types. + + .. index:: -gnatwm (gcc) :switch:`-gnatwm` |