This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/9266: decrement pointer side effects are not working properly
- From: Randy Fields <randy at fieldshome dot com>
- To: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, randy at fieldshome dot com, gcc-gnats at gcc dot gnu dot org
- Date: Fri, 10 Jan 2003 14:57:53 -0700
- Subject: Re: c/9266: decrement pointer side effects are not working properly
- Organization: artisllc.com
- References: <20030110212815.6425.qmail@sources.redhat.com>
Greetings, and thank you for your quick response. I see that depending
on the side effects of these types of statements (pointer decrement) is
not a good habit to be in, and will promptly change my own code so that
it works. However, this same code base has been running (and compiling)
across many different platforms and compilers (MS VC++ 4,5,6,7, IRIX,
earlier versions of gcc) for six years. This is the first time we have
encountered the problem. I'm not saying that what the other compilers
are doing is correct, only that someone there may want to look more
closely at it for compatability sake. I see several bugs on the list
that could potentially be caused by this very problem. I'll be glad to
provide assembler code dumps, or any assistence that I can, if needed.
Thanks,
Randy Fields
Artis LLC
Research Programmer
bangerth@dealii.org wrote:
Synopsis: decrement pointer side effects are not working properly
State-Changed-From-To: open->closed
State-Changed-By: bangerth
State-Changed-When: Fri Jan 10 13:28:13 2003
State-Changed-Why:
You're changing the same variable twice in the same statement,
and the result depends on the order in which this happens.
This invokes undefined behavior -- don't do this.
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9266