4 ms·
As you surely know if you're quoting the standard, it depends on which standard!
by s3graham 1y ago
As you surely know if you're quoting the standard, it depends on which standard!
- gpderetta 1y agoI believe that since C23 foo() is now a nullary function. As this is the last approved standard and it supersedes all previous standards, it is technically correct to say that de-jure this is what the (unqualified) C standard mandates. Of course de-facto things are more nunanced.
- el_pollo_diablo 1y agoC23 does not change anything in this situation, because we are talking about the definition of main(), not a forward declaration. More details here: https://news.ycombinator.com/item?id=38729278#38732366 https://news.ycombinator.com/item?id=38729278#38732366
- fuhsnn 1y agoIn what situation fn() doesn't mean fn(void) under C23?
- el_pollo_diablo 1y agoNone, but that is not my point. Before C23, fn() already meant the same thing as fn(void) in function definitions, which the situation under discussion here. C23 changed what fn() means outside a function definition.
- fuhsnn 1y agoOh, yeah, the codegen for the fn() itself would likely be the same, but the prototype of that definition is still a K&R function. https://godbolt.org/z/Psvae55Pr https://godbolt.org/z/Psvae55Pr
- tedunangst 1y agoQuote a different standard.