diff options
author | Sheri Bernstein <bernstein@adacore.com> | 2023-08-01 16:36:14 +0000 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-09-05 13:05:11 +0200 |
commit | 105891ca1beda7aecb2b637cc62f5c8a3ac49386 (patch) | |
tree | 99c79874cb37f833c549af5d9b274e83c6e80687 /gcc/ada/accessibility.adb | |
parent | 8950360830f0d7f5f356ec447e8493be7b98c2cb (diff) | |
download | gcc-105891ca1beda7aecb2b637cc62f5c8a3ac49386.zip gcc-105891ca1beda7aecb2b637cc62f5c8a3ac49386.tar.gz gcc-105891ca1beda7aecb2b637cc62f5c8a3ac49386.tar.bz2 |
ada: Handle GNATcheck violations
For the GNATcheck rule "Improper_Returns", either use pragma Annotate
to exempt the violation with the rationale "early returns for performance",
or refactor the code by replacing multiple returns by a single return
statement with a conditional expression; this is more readable and
maintainable, and also conformant with a Highly Recommended design principle
of ISO 26262-6. For the GNATcheck rule "Discriminated_Records", use pragma
Annotate to exempt the violation with the rationale "only variant records
are disallowed".
gcc/ada/
* libgnarl/a-reatim.adb (Time_Of): Add pragma to exempt
Discriminated_Records.
* libgnat/s-imguti.adb (Round, Set_Decimal_Digits): Likewise.
* libgnat/s-multip.adb (Number_Of_CPUs): Likewise.
* libgnarl/s-tpopsp__posix-foreign.adb (Self): Refactor multiple
returns.
Diffstat (limited to 'gcc/ada/accessibility.adb')
0 files changed, 0 insertions, 0 deletions