Whay is a C compiler ANSI compatible?

that

compiler?

I didn't interpret it that way since none of the standards say anything about the generated output of the compiler.

Correct -- as it is with all programming language standards.

You can expect to get a result of 2 if you say 1 + 1.

The size of data types is a well-known area of implementation-defined behavior.

Reply to
Everett M. Greene
Loading thread data ...

that

compiler?

but what about:

unsigned char x = 255; x++;

The standard specifies that unsigned char rolls over when it reaches maximum but 255 isn't necessarily maximum. Here both 0 and 256 are valid outputs.

Reply to
slebetman

there are a number of very good reasons, the mythical "well defined interfaces" requires knowledge of future products, results in very large complex code to handle all the different types of interfaces, increases testing costs, size of executable, results in "dead code" which is sometimes not allowable in meet certification requirements etc etc etc

Reply to
steve

No, he meant what he said, because he was talking about (a && b). Your suggestion doesn't work out for that. It would work for (a || b) instead. If you don't believe me, break out a pen and paper and work out the results for all combinations of a and b being either zero or three.

Reply to
Hans-Bernhard Bröker

It OK, I rite compilers. I made goof. No pen and papya needed. :-)

Reply to
Richard

It depends. Is your code "ANSI compatible"?

Reply to
Eric Smith

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.