[Cfp-interest] Undefined behavior vs recommended practice

Fred J. Tydeman tydeman at tybor.com
Wed Nov 28 15:20:59 PST 2012


I think that the following should be added after many
mentions of undefined behavior:


Recommended Practice

This undefined behavior should be treated as if an #error had been
encountered.

Reason: I think that compilers should detect errors as soon as
possible.  If an error condition can be detected during translation,
then I think translation should fail.  The only way to cause
translation to not be successful is to encounter an #error.



---
Fred J. Tydeman        Tydeman Consulting
tydeman at tybor.com      Testing, numerics, programming
+1 (775) 287-5904      Vice-chair of PL22.11 (ANSI "C")
Sample C99+FPCE tests: http://www.tybor.com
Savers sleep well, investors eat well, spenders work forever.



More information about the Cfp-interest mailing list