- The tag std refers to the C++ namespace which is used for the standard library. This has been the case since 2011 when the tag wiki was added.
stdlib
is a C librarystdlib.h
which does not currently have its own tag.- For some reason, std and stdlib tags are synonymous.
For this reason we have 102 questions tagged c and std, the combinations not making any sense. Sometimes the question means stdlib.h
, sometimes it means "standard C", sometimes it means something else.
All in all, there is a total of 259 questions not tagged c++ but using std. Many appear to be C or C++ questions, but I also see questions about other languages, Python in particular.
Proposal:
- Rename std to c++-std, std-keyword, std-namespace or a similar suitable name for the C++ keyword
std
. - Remove synonym between std and stdlib. Possibly rename stdlib to stdlib.h.
- Possibly blacklist std, because it's a very ambiguous tag name.
- All 259 questions tagged std but not c++ probably need to be reviewed.
- C++ questions regarding
stdlib.h
could do with a new tag cstdlib. Not sure if that one should be synonymous with stdlib.h or not.
EDIT
Clarification for those without domain knowledge:
- The C standard library contains of a bunch of "headers", sub-libraries of the library as whole. One such sub-library is
stdlib.h
, which contains misc general functions. There is no apparent use for a tag referring to the whole "C standard library". libc
is a specific open source implementation of the C standard library, specific to Linux/POSIX. It has absolutely nothing to do with this topic. That tag is fine as it is, leave it be.- C++ contains most of the C standard library (including
stdlib.h
). - In C++, there is an alternative way of including C standard library headers by using
#include <cstdlib>
rather than#include <stdlib.h>
. Even beginners are supposed to know this, so it is fine to make cstdlib and stdlib.h synonymous. Apart from different ways to include it, it is the very same library in C and C++ both. - In C++, all functions belonging to the C++ standard library are placed in the same namespace called
std
. So it is common to prefix C++ standard library functions or classes withstd::
when you use them. Thestd
tag should supposedly be about the use of this namespace. - There is in my opinion definitely a need for a tag for the
std
namespace, since failing to use the correctusing
statement to point at items in thestd
namespace leads to common problems. There's also a common FAQ regarding not to useusing namespace std
. All of these are C++ FAQ questions.
stdlib(.h)
is a library for C, but your last bullet point indicates you think there are C++ questions regardingstdlib(.h)
? And that somehowcstdlib
would be understood as "C++ stdlib", rather than just "C stdlib"?stdlib.h
is part of C++, since it's a C header. The languages uses slightly different ways of including this library though: C uses#include <stdlib.h>
and C++ prefers to#include <cstdlib>
. The former is valid in C++ but obsolete style, the latter is recommended. So I expect a bunch of tags calledcwhatever
for the corresponding C++ naming. It refers to the same headers though.include <cstdlib>
brings in all identifiers in namespacestd
and optionally also in the global namespace.include <stdlib.h>
brings in all identifiers in the global namespace and also optionally in namespacestd
. I mention this only because you say that they are exactly the same.