I also object to the presupposition that there is secure software and non-secure software. In most practical cases, it is impossibly hard to tell in which class an application falls, so it would be better not to make that distinction at all.
I also object to the presupposition that there is secure software and non-secure software. In most practical cases, it is impossibly hard to tell in which class an application falls, so it would be better not to make that distinction at all.
Isn't the reason for a lot of undefined behavior either in the name of performance through optimization and assumptions, portability because the implementation can just do whatever the underlying platform natively does or the committee just couldn't agree on it?
All three of those scenarios appear inherently unfixable to me without a separate sub-standard that intentionally clamps down on performance/ease of portability and actually gets the committee to agree.
https://www.cs.berkeley.edu/~wkahan/JAVAhurt.pdf
If C had standardised to the idiosyncracies of the PDP-11, it might have held back its development.
IEEE754 was based on the design of the 8087, and it's been native on x86 since the 80387.
The problem with Java choosing IEEE754 was, according to the paper you linked, not that it wasn't supported on all hardware, but that Java didn't follow the spec completely,
"Later we shall see why Java’s expanded market would be served better by actual conformity to the letter and spirit of IEEE Standard 754"
All compilers on the same platform have done the same exact thing with the same "undefined" behavior.
At the moment, all platforms are x86. Previously, all platforms were SPARC, and before that, VAX.
My iPhone, Raspberry Pi, Chromecast, Xbox, and PlayStation disagree with you.
Non-x86 are still present.
*p;It’s what we do in Java, too.
if (!p) { return -1; } else { do something; }
if (!p) { return -1; } else { do something else; }
if (!p) { return -1; } else { do even more; }
...
And now, you want the compiler to remove all these redundant checks.Moreover, you very likely don't want warnings here.
I think it's worth noting that some critical code, such as the Linux kernel, already opts out of such optimizations because they've been bitten by it in the past. My previous post talks about that.
Some of it is indeed a problem with the standard. There are other bits though where portability or optimization needs kind of require some level of "undefined" behaviour for the standard. There really are some bits of code that perhaps can't be as portable and/or as efficient if you code for safety.
I'm with you 100% here. Especially without a more precise definition of what we mean by "secure".
> In most practical cases, it is impossibly hard to tell in which class an application falls, so it would be better not to make that distinction at all.
Unfortunately, it seems that it's really quite easy to tell. Unless you have overwhelming evidence [1] that says the software is "secure", it's almost certainly going to turn out to be insecure.
[1] For example: seL4 and its proofs of correctness http://sel4.systems/
It really is difficult to draw that boundary.