3 ms·
Now it's definitely specified that a compiler can interpret this: void*x = trk->x; if(!trk) return 0; return doit(x); as: return doit(trk->x)
by geocar 10y ago
Now it's definitely specified that a compiler can interpret this:
void*x = trk->x;
if(!trk) return 0;
return doit(x);
as:
return doit(trk->x);
but is that right?
Compiler writers can argue that this kind of optimization is useful because it makes other kinds of optimizations easier to implement, but the argument isn't that it's "technically correct" so they must. They have to argue on the merits of the decision, and if they fail to be convincing, people will find other solutions.
The DNS specification required clients use source port 53. I think this is dumb because it made it easy to spoof DNS requests -- simply generate 30k UDP packets in a short period of time for a domain name that is commonly requested (like yahoo.com) on a DNS server that's popular (like opendns).
If only clients would use a random source port, the number of packets goes into the billions.
A few DNS clients ignored the specification because it was wrong, but a few DNS clients stood their ground insisted that it was specified so it was right. I remember the smear campaign referring to one of those secure DNS clients as "not standard compliant". Brutish, but it was effective: Some people remained insecure for a very long time simply because they trusted the standardization process as right and truth.