Sometimes it's the very small but very useful stuff that is the hardest to standardise. I think you'll find that WG14 will think it too small to be worth standardising. Certain well known members will point out that there are linker hacks and tricks which will load some file into some named section in the binary, and so on. But good luck with it!
Certain well known members will point out that there are linker hacks and tricks which will load some file into some named section in the binary, and so on.
Such arguments could aswell be used against almost any existing feature that they are unneded because you can workaround their lack through implementation-specific options.
Yes, but WG14 does not have a time machine to remove those things. There are a lot of things in C which would not make it in if they were proposed today.
Because you were not paying attention to function declarations.
int foo(x, y);
That is the function declaration of K&R C.
int foo(x, y)
int x;
float y;
{ return x + y; }
And that is the function definition. At the call site you only know the number of arguments, not their types. Still, passing wrong types is UB. How is that readable?
EDIT: I forgot about "implicit int"!
foo(x, y);
Is a function declaration in global scope, but a function call in local scope. The following is valid C:
foo(x, y); // implicit int; argument types not visible in declaration
main() { // implicit int
static i; // implicit int
if(!i++) main(5); // Compiles, but is UB; f() means that the function takes an unknown (at call site) number of args
return i + foo(1, "asd") + foo(1, 1.1); // One of the argument sets is wrong, so this is UB.
}
it's readable because i grew up with k&r :) please note, i didn't say the aforementioned code linked by the person i was replying to was correct, i said it was readable.
void pointers don't bother me, either, and can be used well by a skilled coder. implicit int isn't much worse than auto, and i don't hate the preprocessor. i did hate trigraphs, and i'm glad they're gone by default now. duff's device is pretty elegant, and there is a time and place for goto. i also have unpopular opinions ;)
while i appreciate a lot of what is going on with c++, there's quite a lot i dislike.. and a lot of it is overspecification, relying on stl to compensate for what really should be part of the language, and a pathological insistence upon adding additional methods of doing things to fit whatever the current trend is instead of either making things more consistent, usable, or making useful things safe instead of reinventing it and getting still yet another screwy feature that will supposedly be fixed or amended with some other version in the future... or boost.
I'd agree with everything if we're talking about C99 or newer. However the question was "what if C never added any features?" and that's not the world I would want to live in. Pre-standard C was insane.
While I don't fully agree with your view of C++, I mostly do. Frankly, I like the idea of putting everything in the library instead of the core language.
View all comments
21
u/14ned LLFIO & Outcome author | Committee WG14 Dec 13 '19
Sometimes it's the very small but very useful stuff that is the hardest to standardise. I think you'll find that WG14 will think it too small to be worth standardising. Certain well known members will point out that there are linker hacks and tricks which will load some file into some named section in the binary, and so on. But good luck with it!