ada: Improve detection of deactivated code for warnings with -gnatwt
4 August 2023 at 13:01
ada: Improve detection of deactivated code for warnings with -gnatwt Switch -gnatwt is used in GNAT to track deleted code. It can be emitted by GNAT on code that is intentionally deactivated for a given configuration. The current test to suppress spurious warnings is not complex enough to detect all such cases. Now improved, by using the same test as used in GNATprove to suppress warnings related to a "statically disabled condition which evaluates to a given value", as described in SPARK UG 7.3.2. gcc/ada/ * exp_util.adb (Is_Statically_Disabled): New function to detect a "statically disabled condition which evaluates to a given value", as described in SPARK UG 7.3.2. (Kill_Dead_Code): Call the new function Is_Statically_Disabled for conditions of if statements. * exp_util.ads (Is_Statically_Disabled): New function spec.