This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Wfutile-unsigned-comparison (PR7651 Define -Wextra strictly in terms of other warning flags)

:ADDPATCH middle-end:

This patch continues the effort to fix PR7651 [1].

It adds a new option -Wfutile-unsigned-comparison that takes over the
function of warning  about comparison of unsigned variables against
zero with < or >=. The new option is enabled by -Wextra, so we keep
the current behaviour but add the ability to enable/disable this
individual warning.

Bootstrapped and regression tested with --enable-languages=all on

OK for mainline?


2006-12-23 Manuel Lopez-Ibanez <>

   PR middle-end/7651
   * c.opt (Wfutile-unsigned-comparison): New.
   * doc/invoke.texi (Wfutile-unsigned-comparison): Document it.
   (Wextra): Enabled by -Wextra.
   * c-opts.c (c_common_post_options): Enabled by -Wextra.
   * c-common.c (shorten_compare): Replace Wextra with

2006-12-23  Manuel Lopez-Ibanez  <>

   PR middle-end/7651
   * gcc.dg/Wfutile-unsigned-comparison.c: New.
   * gcc.dg/Wfutile-unsigned-comparison-Wextra.c: New.
   * gcc.dg/Wfutile-unsigned-comparison-no.c: New.
   * g++.dg/warn/Wfutile-unsigned-comparison.C: New.
   * g++.dg/warn/Wfutile-unsigned-comparison-Wextra.C: New.
   * g++.dg/warn/Wfutile-unsigned-comparison-no.C: New.

Attachment: wfutile-unsigned-comparison.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]