]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Replace redundant conditions with assertions
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 19 Dec 2023 09:23:55 +0000 (10:23 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Mon, 6 May 2024 09:11:27 +0000 (11:11 +0200)
commite5a71415c32db32bf2c20a597f6191990ed1a0be
tree6968ce82288b49be243ba25365da03b6646e2e7a
parentbd2462a8473b7ee7cabd4040553ae13606273723
ada: Replace redundant conditions with assertions

Fix warnings from the CodePeer. The code structure is essentially:

  if A and B then ...
  elsif not A and not B then ...
  elsif A then ...
  elsif B then ...  --  this condition is redundant
  end if;

and it causes CodePeer to say "exception is raised in a conditional
branch", which most likely means that the condition is redundant.

gcc/ada/

* make.adb (Scan_Make_Arg): Remove redundant condition.
* switch-b.adb (Scan_Debug_Switches): Likewise.
* switch-c.adb (Scan_Front_End_Switches): Likewise.
gcc/ada/make.adb
gcc/ada/switch-b.adb
gcc/ada/switch-c.adb