4 ms·
> With relatively few exceptions, if your program hits undefined behavior, then your program was already doing something pretty wrong to begin with. The author
by lixtra 5y ago
> With relatively few exceptions, if your program hits undefined behavior, then your program was already doing something pretty wrong to begin with.
The author claims:
“We have the absurd situation that C, specifically constructed to write the UNIX kernel, cannot be used to write operating systems. In fact, Linux and other operating systems are written in an unstable dialect of C that is produced by using a number of special flags that turn off compiler transformations based on undefined behavior (with no guarantees about future “optimizations”). The Postgres database also needs some of these flags as does the libsodium encryption library and even the machine learning tensor-flow package.”
So basically the programers of the most used C programs consider the C standard so broken that they force the compiler to deviate from it. (Or they are not able to do things right?)
- nytgop77 5y agoSomewhat similar to sql situation. (difference being, i am not sure if anybody implements ansi-sql fully) Standard is just common denominator agreed by actual competitors. (Standard takes into account the chipset where incrementing max_int produces a beep instead of min_int). If user wants to use more advantages of the product (dbms/compiler/hardware), one must sacrifice portability and use cnonstandard extensions.