Re: Same code and different result, Why?
- From: Tommy <tommy767@xxxxxxxxx>
- Date: Fri, 07 Nov 2008 17:45:39 -0500
Alex Blekhman wrote:
and best from what I tell, its a MS Compiler issue only - excused with the documented sequence point idea.
No, it is undefined for all other compilers, as well. The notion of sequence point is common for all C/C++ compilers. However, the exact place where sequence point occurs may vary from vendor to vendor.
I think that B. Stroustrup answerd to you claim better than I could:
"Why are some things left undefined in C++?"
http://www.research.att.com/~bs/bs_faq2.html#undefined
Alex, you missed the point. I'll try it this way.
In every technology, protocol, what have you, when they is a lack of consensus, in principle, you use the best practice. This is part for the course for the technology you are using right now, the compiler, including the news groups protocol NNTP (RFC 977) you are using, as well as, and especially in Email (RFC 5321) technology.
In all cases, it is not that behavior is not defined, it is indeterministic, there could be many behaviors but generally well defined set of behavior. So in principle, there is lack of consensus for what is the correct behavior - which one is deemed "more" correct.
My point, and I strongly believe this from a functional programming statement, which many will argue that C is quite indeed a functional programming model, that given all the different constructs you can come up that emulate the same idea, all of them, produce the same result but the one Microsoft choose for its compiler for the simplest construct:
x = x++ + y++;
So while we all agreed and acknowledge that this is generally considered an axiom that may produce different results depending on the compiler, when you look at the BCP (Best Current Practice) that exist for the possible results, the MS solution is the least common one.
BCP is something one must be aware of otherwise when they do confront situations like this and guaranteed that you will, they will generally get it wrong and not be compatible with the rest of the world.
---
.
- Follow-Ups:
- Re: Same code and different result, Why?
- From: Bo Persson
- Re: Same code and different result, Why?
- From: Alex Blekhman
- Re: Same code and different result, Why?
- From: Alexander Grigoriev
- Re: Same code and different result, Why?
- From: Nathan Mates
- Re: Same code and different result, Why?
- References:
- Same code and different result, Why?
- From: Lorry Astra
- Re: Same code and different result, Why?
- From: Alex Blekhman
- Re: Same code and different result, Why?
- From: Tommy
- Re: Same code and different result, Why?
- From: Ulrich Eckhardt
- Re: Same code and different result, Why?
- From: Tommy
- Re: Same code and different result, Why?
- From: Alex Blekhman
- Same code and different result, Why?
- Prev by Date: Re: Same code and different result, Why?
- Next by Date: Re: Same code and different result, Why?
- Previous by thread: Re: Same code and different result, Why?
- Next by thread: Re: Same code and different result, Why?
- Index(es):
Relevant Pages
|