aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/sql/DriverManager.java
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2022-10-13 16:51:08 -0400
committerMarc Poulhiès <poulhies@adacore.com>2022-11-07 09:36:33 +0100
commit981848b598c8a35a76c7fc226ac07852d9061f43 (patch)
tree38beba3b6c053dd4791a3d9c306fe6a7073d62d3 /libjava/java/sql/DriverManager.java
parent214b1cb8a829568c7ef675b7c3e6a2d8b9a96875 (diff)
downloadgcc-981848b598c8a35a76c7fc226ac07852d9061f43.zip
gcc-981848b598c8a35a76c7fc226ac07852d9061f43.tar.gz
gcc-981848b598c8a35a76c7fc226ac07852d9061f43.tar.bz2
ada: Suppress warnings on derived True/False
GNAT normally warns on "return ...;" if the "..." is known to be True or False, but not when it is a Boolean literal True or False. This patch also suppresses the warning when the type is derived from Boolean, and has convention C or Fortran (and therefore True is represented as "nonzero"). Without this fix, GNAT would give warnings like "False is always False". gcc/ada/ * sem_warn.adb (Check_For_Warnings): Remove unnecessary exception handler. (Warn_On_Known_Condition): Suppress warning when we detect a True or False that has been turned into a more complex expression because True is represented as "nonzero". (Note that the complex expression will subsequently be constant-folded to a Boolean True or False). Also simplify to always print "condition is always ..." instead of special-casing object names. The special case was unhelpful, and indeed wrong when the expression is a literal.
Diffstat (limited to 'libjava/java/sql/DriverManager.java')
0 files changed, 0 insertions, 0 deletions