This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/37947] p->count += inc(p); // value of p->count is wrong, if inc(p) not only returns an int but also increases p->counter
- From: "micirio at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Oct 2008 01:44:41 -0000
- Subject: [Bug c/37947] p->count += inc(p); // value of p->count is wrong, if inc(p) not only returns an int but also increases p->counter
- References: <bug-37947-16874@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from micirio at gmx dot net 2008-10-29 01:44 -------
Thanks for the quick answer. Is it possible to get a warning if I write
undefined code like this? -Wall didn't tell me anything.
I'm asking, because I need to convert an existing (old) project where I found
this line that caused a segfault at a very other point in the source. So a
warning would avoid some odd surprises.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37947