Re: C Test Incorrectly Uses printf() - Please Confirm

Eric Sosman wrote:
On 8/10/2010 1:45 AM, Shao Miller wrote:
It might be beneficial to divide "undefined behaviour" into two types:
- Undefined behaviour due to a lack of definition in a C Standard (not
defined; doesn't appear)
- Undefined behaviour declared to be such in a C Standard (defined not
to have further definition in the Standard)

The division is probably not beneficial. For starters, the
Standard itself says explicitly that "There is no difference in
emphasis among these three;[*] they all describe ‘‘behavior that
is undefined’’."

[*] The text subdivides your second category into two finer-
grained types -- and then lumps them all back together under
"There is no difference."

I'm well aware of that referenced text. In fact, I thought it was a good idea to read just before posting that post.

Did you stop reading the post where you began your reply? Instead of arguing about emphasis as used in the Standard (which was not the subject), do you not agree to the benefits I suggested for purposes of discussion? Do you see how the division allows for two types of distinct outcomes?

Relevant Pages

  • Re: Questions about C1x
    ... POSIX uses the C standard definition, ... described here and the ISO C standard is unintentional. ... On implementations that do not detect output string ...
  • Re: removing a loop cause it to go at half the speed?
    ... We can agree that undefined behaviour is "behavior, ... for which this International Standard imposes no requirements" from ... since what is a trap on one implementation could be valid on another. ... which accesses an uninitialized int is strictly non-portable, ...
  • Re: memory allocation question
    ... > | Unless there's wording in the standard guaranteeing portabilty, ... Only some cases of undefined behaviour ... program construct or erroneous data, ... International Standard imposes no requirements. ...
  • Re: If It Were Easy...
    ... Why should I rewrite the standard? ... That's a use of "miscompile" with my meaning. ... exploiting such an undefined behaviour, you and the LLVM people would ... (and that's why I see the C compiler maintainers as culprits). ...
  • Re: How programming in C got me in trouble with the law
    ... Where the Standard specifies that the behaviour is ... running Spyware. ... If I had reason to believe that a compiler might start running ... spyware after encountering undefined behaviour I wouldn't ...