public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/36050]  New: Ternary operator warning on assignment used as truth value
@ 2008-04-25 22:17 ianw at vmware dot com
  2008-04-27 22:14 ` [Bug c/36050] " manu at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: ianw at vmware dot com @ 2008-04-25 22:17 UTC (permalink / raw)
  To: gcc-bugs

Hi,

It would be great if ? warned when it got a (presumably accidental) assignment
like if statements do; e.g.

$ cat test.c
int main (void)
{
        int i;
        return (i = 20) ? 10 : 15;      
}
$ gcc-4.3 -Wall test.c 

It seems like this would be quite a common mistake?


-- 
           Summary: Ternary operator warning on assignment used as truth
                    value
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ianw at vmware dot com


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


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

* [Bug c/36050] Ternary operator warning on assignment used as truth value
  2008-04-25 22:17 [Bug c/36050] New: Ternary operator warning on assignment used as truth value ianw at vmware dot com
@ 2008-04-27 22:14 ` manu at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-04-27 22:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from manu at gcc dot gnu dot org  2008-04-27 22:13 -------


*** This bug has been marked as a duplicate of 25733 ***


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2008-04-27 22:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-25 22:17 [Bug c/36050] New: Ternary operator warning on assignment used as truth value ianw at vmware dot com
2008-04-27 22:14 ` [Bug c/36050] " manu at gcc dot gnu dot org

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).