IRC channel logs

2026-05-22.log

back to list of logs

<JohnCowan>mwette: Make it "auto" . :-)
<mwette>JohnCowan: haha, is that even C? ; I know it's C++
<ft>"auto" was always a thing in C. But in C23 it changed its meaning to do C++ style type inference.
<ft>Before is was the default storage duration keyword (another one is "static"), and since it was the default, nobody would type it out. I'd bet, that is why the C commitee dared to change its meaning, because nobody would ever have it in their code anyway.
<mwette>ah, right, the old "auto" was not used much that I ever saw
<ft>Yup
<mwette>the old meaning is not missed
<mwette>thanks ft
<ft>You're welcome.
<humm>the old auto was used before the language had types and in C89 it still made sense to use it if you liked implicit int
<dsmith>sneek, botsnack
<sneek>:)
<JohnCowan>I don't read it as a change of meaning of auto, it's just that instead of the default type being int", it is now 'whatever fits".
<humm>you can do the “whatever fits” for non-automatic variables too
<humm>so auto f = 42.5f; at file scope gives you a float f with static storage duration
<JohnCowan>ah, that *is*new