gcc-bugs@gcc.gnu.org
[Top] [All Lists]

[Bug c/37947] missing sequence point warning for 'count += inc(&count);'

Subject: [Bug c/37947] missing sequence point warning for 'count += inc(&count);'
From: "manu at gcc dot gnu dot org"
Date: 29 Oct 2008 15:46:43 -0000

------- Comment #7 from manu at gcc dot gnu dot org  2008-10-29 15:46 -------
(In reply to comment #6)
> Warning is (reliably) only possible if we can tell if the function call
> modifies
> the passed storage.  This requires some IPA analysis and thus moving the
> warning to the middle-end.

I don't want that at all. I wonder how much correct code is written like this
against how much incorrect code. However, now I realize that any function call 

counter += inc();

can trigger this if counter is a global variable. So this is impossible to get 
right 100% and it is not probably practical to move to the middle-end, since it
is very front-end specific.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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

<Prev in Thread] Current Thread [Next in Thread>