|
|
Subscribe / Log in / New account

Who's afraid of a big bad optimizing compiler?

Who's afraid of a big bad optimizing compiler?

Posted Jul 27, 2019 9:36 UTC (Sat) by Wol (subscriber, #4433)
In reply to: Who's afraid of a big bad optimizing compiler? by andresfreund
Parent article: Who's afraid of a big bad optimizing compiler?

Do you mean the compiler optimised away the tests for overflow, on the basis that overflow couldn't happen? Crazy! :-)

Surely a simple way for the standards committee would simply be to define a bunch of pragmas that said "this implementation-defined feature is required", and say that the compiler must terminate with a fatal error if it's not supported.

Okay, that then means that the poor programmer needs to add a bunch of requirements at the start of his program, but it also means that if he attempts to port to a different architecture that doesn't support his assumptions, the compiler will refuse to compile. Much better than everything appearing to work and then falling over in a heap in production.

Cheers,
Wol


to post comments


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