Richard said:
But that _is_ special, because it means that every (hosted)
implementation must provide them, and therefore that every C programmer
must know about them.
"Must"? No. There are plenty of Standard Library functions I know
nothing about; I see new (to me) ones mentioned here regularly. It is
hardly mandatory that _every_ programmer must know them; they may
accidentally invoke UB if they don't, but you can write C programs just
fine without using (or even knowing) _any_ of the Standard Library.
I've written a lot of POSIX-specific code that _never_ uses the Standard
Library or includes any of the Standard headers, and a lot more that
doesn't use any Standard functions except snprintf().
In this, they are completely different from functions from any third-
party library.
I can see your point, though I disagree with it. The Standard Library
is required to be there (on hosted systems), and it's implementation is
almost always linked in by default, but otherwise it is no different
from any other library, and I see no point in treating it as "special"
when it's easier _not_ to do so.
While not directly relevant, the designers of C++, Java, C#, etc. put
their standard libraries in separate name spaces; I don't know exactly
why, but I'd be hesitant to ignore their example without a very
compelling reason, which you have yet to provide...
This requires the innocent programmer to jump through hoops, only
because some library writer wasn't paying attention.
I have no problem if you want to suggest that foo::strcpy needs to be in
a name space. But the Standard strcpy() should not need to be.
Ah, but when foo::strcpy() is the one you get when you type just
strcpy(), how are you going to specify the Standard strcpy()?
I understand why you think that's a bad situation to put yourself in,
and I avoid it (or any other name space conflicts) when at all possible,
but a solution is still needed at times through no fault of the
programmer who's stuck with the problem, and C++'s solution is
reasonable and easy.
You guys keep talking as if the Committee adds functions left, right and
centre, all the time, and there's no way for us poor programmers to keep
our code clean. Well, they don't. Every ten years or so (if that) they
bring out a new Standard. _And_ the old ones continue to be around, and
compilers continue to compile to the old Standards as well as the new
one.
One of the reasons that ISO is so reluctant to add new functions is that
they don't want to break existing code...
It's not the most serious problem, I'll grant, but it's one that can't
be ignored entirely, particularly when there's an easy solution to it.
There's no solution at all to the problems with adding new keywords,
which is one of the reasons that "static" means so many darn different
things when there really should be different keywords for each use...
Grmbl. I considered adding "(should)" to that sentence, but couldn't
bear the broken grammar. I should have.
S