35
  • The tag 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 library stdlib.h which does not currently have its own tag.
  • For some reason, and tags are synonymous.

For this reason we have 102 questions tagged and , 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 but using . Many appear to be C or C++ questions, but I also see questions about other languages, Python in particular.

Proposal:

  • Rename to , , or a similar suitable name for the C++ keyword std.
  • Remove synonym between and . Possibly rename to .
  • Possibly blacklist , because it's a very ambiguous tag name.
  • All 259 questions tagged but not probably need to be reviewed.
  • C++ questions regarding stdlib.h could do with a new tag . Not sure if that one should be synonymous with 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 and 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 with std:: when you use them. The std 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 correct using statement to point at items in the std namespace leads to common problems. There's also a common FAQ regarding not to use using namespace std. All of these are C++ FAQ questions.
10
  • You said stdlib(.h) is a library for C, but your last bullet point indicates you think there are C++ questions regarding stdlib(.h)? And that somehow cstdlib would be understood as "C++ stdlib", rather than just "C stdlib"?
    – TylerH
    Commented Aug 31, 2020 at 13:50
  • 1
    Related (possibly dupe): meta.stackoverflow.com/q/398798/10871073 Commented Aug 31, 2020 at 14:11
  • @AdrianMole Yep it's a dupe but the answers there aren't great. Hmm maybe someone messed up the synonyms lately, since that thread is very recent.
    – Lundin
    Commented Aug 31, 2020 at 14:24
  • @Lundin I've also come across a number (quite a lot, actually) of suggested edits by the OP of that post - removing one or other of the C /C++ tags, or changing the tag to better fit the actual language. But yeah - the whole thing is a bit messy. Commented Aug 31, 2020 at 14:28
  • 2
    @TylerH 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 called cwhatever for the corresponding C++ naming. It refers to the same headers though.
    – Lundin
    Commented Aug 31, 2020 at 14:30
  • I think this brings a whole new idea into the view I wonder never was concerned really (at least I couldn't find posts but anyhow I'm sure it needs to be mentioned at least once anywhere on Meta). --- Why not creating "exclusive only" tags which you only can assign to a question post which is tagged with the appropriate language tag? For example, javascript and std conflict and the question can't be posted. This could solve the problem that std is being used by other languages than c++. Commented Aug 31, 2020 at 15:18
  • 2
    @RobertSsupportsMonicaCellio But what if we actually want to use std with another language? For example Rust. I don't think the advantage would be so big, one would need to maintain and update the tag dependencies. Commented Aug 31, 2020 at 20:10
  • @Trilarion The std tag describes currently a c++-specific feature only. Maybe we need a specific rust-std? Commented Aug 31, 2020 at 20:26
  • 2
    @RobertSsupportsMonicaCellio you are looking for hierarchies of tags. That option was rejected several times due the complexities that such system would bring.
    – Braiam
    Commented Sep 1, 2020 at 14:36
  • Very minor point, but in C++, include <cstdlib> brings in all identifiers in namespace std and optionally also in the global namespace. include <stdlib.h> brings in all identifiers in the global namespace and also optionally in namespace std. I mention this only because you say that they are exactly the same. Commented Sep 3, 2020 at 1:26

2 Answers 2

10

As I mention on from a similar discussion, is being used for multiple 'std's, I completely agree with the fact that this needs to be disambiguated.

Rename to , , or a similar suitable name for the C++ keyword std.

For this, we can use the present itself. That particular tag has 783 questions and a tag wiki.

rename to .

This is one of my other concerns. Are we sure that "stdlib.h" won't be used by the C++ folks, mistaking it for the C++ std? If that's the case, then sure let's go ahead. If not, we should use probably use . Whenever there's confusion between two languages, using the prefixed tags is totally fine. Alternatively, I am a fan of Cris Luengo's suggestion of using the present instead. If we were to use this then, we can add the other suggestion as a synonym for if required. The tag seems to be related to a very specific implementation of standard library, so that tag won't help us out here.

C++ questions regarding stdlib.h

For this, I share the same concern as Tyler. However based on your reply, I understand that both C++ and C "stdlib.h" are the same. If this is the case, then we can create as a synonym for / (or whatever that tag would be named). Having two separate tags for the same "stdlib.h" isn't required.

We can start off by breaking the synonym between and , and then manually sift through the questions here, to either add a / tag and remove the tag, or leave the as is (or just close the question if it is not on-topic).

For the burnination of , that's not required. Once we merge it with , we can just remove the synonym and that should get rid of the tag.

23
  • 2
    I'm not sure we need a tag for one C header file. Also, most of these questions will be asking stuff about the C Standard Library, not specifically about stdlib.h, which is one header file in that library. I would recommend instead making a tag c-standard-library or libc (or both, one as a synonym of the other), if these don't exist yet. Commented Sep 1, 2020 at 4:05
  • 2
    Actually, there already is a libc tag. Commented Sep 1, 2020 at 4:06
  • libc does sound like a good option, I do prefer using existing tags instead of creating new ones. Thanks @Cris. Let me update my answer.
    – Bhargav Rao Mod
    Commented Sep 1, 2020 at 4:11
  • 2
    c++-standard-library ... has 783 questions Just saying, but stl has 14K+ questions, many of which would rightfully belong in c++-standard-library instead. But that would be the topic of another discussion, probably better kept out of this one here.
    – dxiv
    Commented Sep 1, 2020 at 5:41
  • 1
    "Are we sure that "stdlib.h" won't be used by the C++ folks, mistaking it for the C++ std?" Yeah they won't, stdlib.h is a thing in C++ too. Technically it's the very same library in both languages. In C++ it may be referred to as cstdlib as well.
    – Lundin
    Commented Sep 1, 2020 at 6:25
  • 1
    @CrisLuengo "I'm not sure we need a tag for one C header file." We absolutely do - the alternative is to create a tag for every function in that header file. Also the contents in the header file all behave in the same way. C++ ostream, istream, ofstream etc all work the same, so we only need a tag iostream for the whole header.
    – Lundin
    Commented Sep 1, 2020 at 6:27
  • 1
    @CrisLuengo libc refers to a specific open-source standard C library implementation, which only works on Linux/POSIX. Compilers for other systems won't use it. That tag must be preserved for the use of the libc open source project specifically.
    – Lundin
    Commented Sep 1, 2020 at 6:29
  • @Bhargav Rao stdlib.h has nothing to do with libc whatsoever. stdlib.h is a sub library of the whole standard C library. libc is an open source implementation of the whole standard C library.
    – Lundin
    Commented Sep 1, 2020 at 6:31
  • I added some clarification to the question. Though maybe it is for the best if those without domain knowledge step away from this one.
    – Lundin
    Commented Sep 1, 2020 at 6:47
  • The argument about [libc] sounds good, @Lundin, I can update my answer to remove that. Anyway, I did like your update to the post. It does clear out a lot my confusion at least. And of course, I can surely step away from this. I was trying to help you to clear these out, but if y'all can manage, then I'm totally fine with it.
    – Bhargav Rao Mod
    Commented Sep 1, 2020 at 8:18
  • 2
    @Lundin: Don't make assumptions about domain knowledge, please. I understand a tag for iostream, I understand a tag for stdio.h or setjmp.h, but I don't understand a tag for stdlib.h, which contains a grab-bag of functionality (rand, malloc, system, atof are all in there). Plus, I'm pretty sure that most people adding stdlib to their question are thinking of the "standard library", not of this specific header file. Commented Sep 1, 2020 at 14:01
  • @Lundin: The tag excerpt for libc says "The C standard library consists of a set of sections of the ISO C standard which describe a collection of headers and library routines used to implement common operations, such as input/output and string handling, in the C programming language." -- I don't see any reference to any specific implementation. And it is common to refer to the C standard library as "libc", even when not using GCC. See for example the first sentence in the Wikipedia page. Might be correct or not, but it's common use. Commented Sep 1, 2020 at 14:23
  • @CrisLuengo That stdlib.h is a grab-bag is no fault of SO, it's just one of many flaws in the C standard library as whole, which was probably originally designed by grabbing random functions from a UNIX bag indeed. And then they gave it the most stupid, ambiguous name they could come up with.
    – Lundin
    Commented Sep 1, 2020 at 14:23
  • 5
    Regarding stl mentioned above: Pretty much all of those questions are really about the standard library, though some (not few) still use STL as a name for (parts of) the latter. But I doubt that the actual STL as written by Alexander Stepanov in the 90s still has a lot of active users...
    – Baum mit Augen Mod
    Commented Sep 2, 2020 at 20:32
  • 1
    Various C runtime libraries in many implementations have been called libc. The problem with this is that it is not synonymous with the C standard library, but the C runtime with whatever vendor specific extensions there could be. Commented Sep 3, 2020 at 14:08
5

An alternative acceptable tag name for might be .

I think that name might feel more natural to C++ programmers than , which seems a bit artificial and vague.

2
  • 3
    But what about Rust's std namespace? namespace-std would be applicable then, too. Commented Sep 1, 2020 at 12:18
  • 1
    @RobertSsupportsMonicaCellio I suppose it may end up one of those tags that must always be accompanied with the language tag? Getting the tag usage wiki right.
    – Lundin
    Commented Sep 1, 2020 at 12:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .