This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/9266: decrement pointer side effects are not working properly


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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]