Live data from Hacker News

PLOS2021: ISO-C became unusable for operating systems

yodaiken.com

1–10 of 100 posts

Re: PLOS2021: ISO-C became unusable for operating systems

#6
post #3

The fact that a compiler is allowed/encouraged to silently remove whole sections of code because of some obscure factoid is an amazing source of footguns. At least the warnings are getting a bit better for some of these.

Absolutely, those optimisations should be opt-in, otherwise it's impossible to reason about the correctness of your code. At work we had to replace some arithmetic by inline assembly, as there was literally no other way of making the compiler generate the correct expression.

Re: PLOS2021: ISO-C became unusable for operating systems

#8
post #5

The actual title of the paper is "How ISO C became unusable for operating systems development". Is there a particular reason why the first and last words have been removed here?

HN removes words like "how" and "why" automatically. I think it's intended as a clickbait filter. Sometimes the mods change it back.

The submitter may have left out "development" to fit the title in the character limit.

Re: PLOS2021: ISO-C became unusable for operating systems

#9
post #6
post #3

The fact that a compiler is allowed/encouraged to silently remove whole sections of code because of some obscure factoid is an amazing source of footguns. At least the warnings are getting a bit better for some of these.

Absolutely, those optimisations should be opt-in, otherwise it's impossible to reason about the correctness of your code. At work we had to replace some arithmetic by inline assembly, as there was literally no other way of making the compiler generate the correct expression.

I'm very curious to learn more about this as I thought it was easily possible to opt out of the overly aggressive defaults of GCC, Clang, and the like.

Re: PLOS2021: ISO-C became unusable for operating systems

#10
post #6
post #3

The fact that a compiler is allowed/encouraged to silently remove whole sections of code because of some obscure factoid is an amazing source of footguns. At least the warnings are getting a bit better for some of these.

Absolutely, those optimisations should be opt-in, otherwise it's impossible to reason about the correctness of your code. At work we had to replace some arithmetic by inline assembly, as there was literally no other way of making the compiler generate the correct expression.

Could you give an example of such input?
Post reply on HN