User: Password:
|
|
Subscribe / Log in / New account

Reitter: Answering the question: "How do I develop an app for GNOME?"

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 7, 2013 9:24 UTC (Thu) by ncm (subscriber, #165)
In reply to: Reitter: Answering the question: "How do I develop an app for GNOME?" by khim
Parent article: Reitter: Answering the question: "How do I develop an app for GNOME?"

Implementation-defined behavior is worse than undefined behavior. The next version of the implementation will define a different behavior, and your previously well-defined program becomes wrong.


(Log in to post comments)

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 7, 2013 11:46 UTC (Thu) by khim (subscriber, #9252) [Link]

You assume people write program to the spec. Well, newsflash to you: they don't. The very fact that both GCC and LLVM are trying (and failing) to catch a lot of undefined behaviors shows that people don't write to the spec. People write code, they write tests, if they pass - they are happy. That's it.

If program triggers implementation-defined behavior then tests are usually enough to catch problems (because compiler may do different thing from what the programmer expects but it consistently does different thing) while with undefined behavior compiler is absolutely free to do one thing in one case and completely different thing in another case. Which means that program may suddenly crash after compiler upgrade - and you have no idea why.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds