diff options
author | Arnaud Charlet <charlet@adacore.com> | 2020-07-16 12:38:10 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-20 03:21:41 -0400 |
commit | 66b69678563a18c87985456c797b397676094ff0 (patch) | |
tree | 83e52c300516a117442a7be1c8e5b18940f69ba0 /gcc/ada/doc/gnat_ugn | |
parent | 6af3576f431fa716c3a88197355cf1f5ee682ae2 (diff) | |
download | gcc-66b69678563a18c87985456c797b397676094ff0.zip gcc-66b69678563a18c87985456c797b397676094ff0.tar.gz gcc-66b69678563a18c87985456c797b397676094ff0.tar.bz2 |
[Ada] New warning on not fully initialized box aggregate
gcc/ada/
* sem_aggr.adb (Resolve_Aggregate): Warn on not fully
initialized box aggregate.
* sem_aggr.ads: Fix typo.
* sem_res.adb (Resolve_Actuals): Fix typo in error message
format marking it incorrectly as a continuation message.
* sem_elab.adb (Check_Internal_Call_Continue): Similarly, add
missing primary message in case of a call to an actual generic
subprogram.
* sem_warn.adb (Check_References): Do not warn on read but never
assigned variables if the type is partially initialized.
* libgnat/a-except.ads, libgnat/a-ststun.ads,
libgnat/g-sechas.ads, libgnat/a-cbdlli.ads,
libgnat/a-cfdlli.ads, libgnat/a-cobove.ads,
libgnat/a-cohata.ads, libgnat/a-crbltr.ads,
libgnat/a-cbmutr.ads, libgnat/a-crdlli.ads,
libgnat/a-cbsyqu.ads: Address new warning.
* doc/gnat_ugn/building_executable_programs_with_gnat.rst:
Update doc on -gnatwv.
* gnat_ugn.texi: Regenerate.
gcc/testsuite/
* gnat.dg/opt11.adb: Add new expected warning.
Diffstat (limited to 'gcc/ada/doc/gnat_ugn')
-rw-r--r-- | gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst | 19 |
1 files changed, 7 insertions, 12 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 7afe76d..1dec487 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 @@ -3865,8 +3865,14 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch activates warnings for access to variables which may not be properly initialized. The default is that - such warnings are generated. + such warnings are generated. This switch will also be emitted when + initializing an array or record object via the following aggregate: + .. code-block:: ada + + Array_Or_Record : XXX := (others => <>); + + unless the relevant type fully initializes all components. .. index:: -gnatwV (gcc) @@ -3875,17 +3881,6 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch suppresses warnings for access to variables which may not be properly initialized. - For variables of a composite type, the warning can also be suppressed in - Ada 2005 by using a default initialization with a box. For example, if - Table is an array of records whose components are only partially uninitialized, - then the following code: - - .. code-block:: ada - - Tab : Table := (others => <>); - - will suppress warnings on subsequent statements that access components - of variable Tab. .. index:: -gnatw.v (gcc) |