aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnat_ugn.texi
diff options
context:
space:
mode:
authorViljar Indus <indus@adacore.com>2024-08-01 15:59:00 +0300
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-23 10:51:04 +0200
commitdce0d46490cc3f929a5636902f47e2410719e33c (patch)
tree17235f1c2a58a26d5f237dcd586bb23b525695d6 /gcc/ada/gnat_ugn.texi
parent92a9b5527b21b7af8aaaa3cea8553d9b3224f29a (diff)
downloadgcc-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/gnat_ugn.texi')
-rw-r--r--gcc/ada/gnat_ugn.texi27
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi
index 0e3ee93..dcde9ea 100644
--- a/gcc/ada/gnat_ugn.texi
+++ b/gcc/ada/gnat_ugn.texi
@@ -19,7 +19,7 @@
@copying
@quotation
-GNAT User's Guide for Native Platforms , Jul 29, 2024
+GNAT User's Guide for Native Platforms , Aug 19, 2024
AdaCore
@@ -11671,6 +11671,31 @@ Pre’Class, and Post’Class aspects. Also list inherited subtype predicates.
This switch suppresses listing of inherited aspects.
@end table
+@geindex -gnatw_l (gcc)
+
+
+@table @asis
+
+@item @code{-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.
+@end table
+
+@geindex -gnatw_L (gcc)
+
+
+@table @asis
+
+@item @code{-gnatw_L}
+
+`Suppress warnings on inheritely limited types.'
+
+This switch suppresses warnings on inheritely limited types.
+@end table
+
@geindex -gnatwm (gcc)