netbsdusers 6 days ago

You can do the same with a modren C compiler - the extern and auto mean the same and int is still the default type.

1
tialaramex 6 days ago

In C23, auto doesn't have a default type, if you write auto without a type then you get the C++ style "type deduction" instead. This is part of the trend (regretted by some WG14 members) of WG14 increasingly serving as a way to fix the core of C++ by instead mutating the C language it's ostensibly based on.

You can think of deduction as crap type inference.

pjmlp 6 days ago

Design by committee, the outcome is usually not what the people on the trenches would like to get.

uecker 6 days ago

Nobody in the trenches seemed to use old-style auto in the last decades.

BTW: The right place to complain if you disagree would be the compiler vendors. In particular the Clang side pushes very much for keeping C and C++ aligned, because they have a shared C/C++ FE. So if you want something else, please file or comment on bugs in their bug tracker. Similar for other compilers.

Y_Y 6 days ago

> Nobody in the trenches seemed to use old-style auto in the last decades.

To the beat of my knowledge, there was no case where "auto" wasn't redundant. See e.g. https://stackoverflow.com/a/2192761

This makes me feel better about repurposing it, but I still hate the shitty use it's been put to.

saagarjha 6 days ago

What's your better use for it, then?

Y_Y 5 days ago

Synonym for "self" when programming in Greek.

pjmlp 6 days ago

Indeed, however many in the treches would like a more serious take on security, complaining has not served anything in the last 50 years until goverment agencies finally decided to step in.

uecker 6 days ago

This is again a problem compilers could have addressed, but didn't. Mostly because the users in the trenches did not care. Instead they flocked in droves to the compiler optimizing in the most aggressive way and rejecting everything costing performance. So I do not have the feeling that users were really pushing for safety. They are very good at complaining though.

ndiddy 6 days ago

GCC and Clang support asan/ubsan, which lets you trade performance for nicer behavior related to memory access and undefined behavior. Whenever I do C development for a platform that supports asan/ubsan, I always develop and test with them enabled just because of how much debugging time they save.

uecker 5 days ago

Yes. Ubsan you should probably also turn on in production.

pjmlp 5 days ago

It is like democracy, election results not always reflect the needs of everyone, and some groups are more favored than others.

uecker 5 days ago

I think my point is that a standardization committee is not a government.

pjmlp 4 days ago

It surely looks like one from the outside.

Features only get added when there is a champion to push for them forward across all hurdles (candidate), and voted in by its peers (election), at the end of a government cycle (ISO revision), the compiler users rejoice for the new set of features.

uecker 4 days ago

You may have noticed that most features existed in compilers before.

jeltz 6 days ago

Isn't the original inclusion of the auto keyword more in line with what you expect from design by committee? Including a keyword which serves no purpose other than theretical completeness?

pjmlp 6 days ago

I was talking more in general, not specific regarding auto.

Actually I did use C compilers, with K&R C subset for home computers, where auto mattered.

Naturally they are long gone, this was in the early 1990's.

mhh__ 6 days ago

An interesting secondary meaning of "design by committee", the reason why what you mention happens, is "design in committee".

People can skip the usual lifecycle and feedback for an idea by presenting jumping directly to committee stage./

saagarjha 6 days ago

People in the trenches seem pretty happy with what the committee designed here.

windward 6 days ago

It doesn't matter. The people in the trenches don't update their standard versions.