aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-02-02 17:19:59 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2022-05-11 08:53:20 +0000
commitdc9ecb41c8572c53bdcd86e73526e2a27bd3dff9 (patch)
treea3612142caee9d326c7a0fa31d70958c4f24a67c /gcc/ada/gcc-interface
parent4c533da21d6298cdf9eb11df7353b8c8684c7756 (diff)
downloadgcc-dc9ecb41c8572c53bdcd86e73526e2a27bd3dff9.zip
gcc-dc9ecb41c8572c53bdcd86e73526e2a27bd3dff9.tar.gz
gcc-dc9ecb41c8572c53bdcd86e73526e2a27bd3dff9.tar.bz2
[Ada] Detect infinite loops with operators in exit conditions
To warn about infinite loops we detect variables referenced in loop exit conditions. We handle references within boolean operators, i.e. comparison and negation, which are likely to appear at the top level of the condition (e.g. "X > 0"). However, we can easily handle all operators, because they are likely to appear inside the condition (e.g. "abs (X) > 0.0"). Cleanup related to a new restriction No_Uninitialized_Local_Scalars. gcc/ada/ * sem_warn.adb (Find_Var): Detect all operators; replace "condition" to "expression" in comments, because when this routine is called recursively it no longer examines the condition. (Is_Suspicious_Function_Name): Reduce scope of a local variable to avoid shadowing with a parameter of a nested Substring_Present function.
Diffstat (limited to 'gcc/ada/gcc-interface')
0 files changed, 0 insertions, 0 deletions