public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/44949] extend Wparentheses from & to &=
       [not found] <bug-44949-4@http.gcc.gnu.org/bugzilla/>
@ 2011-08-06 20:50 ` marc.glisse at normalesup dot org
  2023-07-20 17:02 ` gsmecher at threespeedlogic dot com
  1 sibling, 0 replies; 2+ messages in thread
From: marc.glisse at normalesup dot org @ 2011-08-06 20:50 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44949

--- Comment #1 from Marc Glisse <marc.glisse at normalesup dot org> 2011-08-06 20:49:40 UTC ---
Created attachment 24935
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24935
hack

It is an easy enough hack to call the Wparentheses code for &= and others (the
warning says "&" instead of "&=", it isn't a clean patch) so I can test on real
code. And it seems painful. It warns on code like: a |= b & c; where it is
quite clear we could never intend (a|=b)&c;. Restricting the warning to the
case where the result of the expression is used should improve things, except
that I don't know how to access that information...


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/44949] extend Wparentheses from & to &=
       [not found] <bug-44949-4@http.gcc.gnu.org/bugzilla/>
  2011-08-06 20:50 ` [Bug c/44949] extend Wparentheses from & to &= marc.glisse at normalesup dot org
@ 2023-07-20 17:02 ` gsmecher at threespeedlogic dot com
  1 sibling, 0 replies; 2+ messages in thread
From: gsmecher at threespeedlogic dot com @ 2023-07-20 17:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44949

Graeme Smecher <gsmecher at threespeedlogic dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gsmecher at threespeedlogic dot co
                   |                            |m

--- Comment #3 from Graeme Smecher <gsmecher at threespeedlogic dot com> ---
Another instance of this bug in the wild, and some encouragement to fix it:

  if(a /= b) {} // whoops - no warning, but highly suspicious

The "/=" corresponds to the inequality operators in several other languages (at
least: ADA, VHDL, Erlang, Fortran). It's a fairly easy typo to make when
switching between them and can be hard to spot when under-caffeinated.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-20 17:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-44949-4@http.gcc.gnu.org/bugzilla/>
2011-08-06 20:50 ` [Bug c/44949] extend Wparentheses from & to &= marc.glisse at normalesup dot org
2023-07-20 17:02 ` gsmecher at threespeedlogic dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).