diff options
author | Bob Duff <duff@adacore.com> | 2019-08-20 09:49:12 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-20 09:49:12 +0000 |
commit | d21ae867a5a83c7c5dd11a2e51d0c4b2ff9e41b8 (patch) | |
tree | 5b8faed21ae8afa0d01919098dd50a21ea2cb429 /gcc/ada/sem_spark.adb | |
parent | cbdb0df117deb12a8e7d63e1cf2b53415b8e92e2 (diff) | |
download | gcc-d21ae867a5a83c7c5dd11a2e51d0c4b2ff9e41b8.zip gcc-d21ae867a5a83c7c5dd11a2e51d0c4b2ff9e41b8.tar.gz gcc-d21ae867a5a83c7c5dd11a2e51d0c4b2ff9e41b8.tar.bz2 |
[Ada] Warn on Unchecked_Conversion to zero-sized array
The compiler usually warns on Unchecked_Conversion between types with
mismatched sizes. This warning is now extended to the case where the
target type is a zero-sized array.
2019-08-20 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch13.adb (Is_Null_Array): New function, used to detect the
null array case; used to warn about uncheckedly converting to a
zero-sized array. It is unfortunate that we can't just check
the size, and warn on all cases of converting from a
nonzero-sized type to a zero-sized one. That's because "0" means
two different things: "size is zero" and "size is unknown".
Until we fix that design flaw, we need this more targeted fix.
gcc/testsuite/
* gnat.dg/unchecked_convert14.adb: New testcase.
From-SVN: r274725
Diffstat (limited to 'gcc/ada/sem_spark.adb')
0 files changed, 0 insertions, 0 deletions