18

In a recent question about a unknown language feature, a user tagged the question with . This makes sense to me, considering the code is in fact C.

On the other hand, the unknown parts of the syntax represented compiler extensions features, not strict part of the language standard. A moment later another user removed the C tag with the argument:

this question uses gcc-specific extensions (and asks specifically about them), thus this question is off-topic for C and on-topic for gcc.

It is important to note that the extensions discussed are not exclusive to the GCC compiler, they exist in others as well. However the inclusion or not of the language tag remains an open question. To my eyes including it is relevant, since the code is C and at the questioner point of view it is inevitably a unknown language feature (if known to be an extension, the question would be worded completely differently). However to the editor's eyes, the language tag is off topic since an extension is not part of the standard described in the tag wiki:

This tag should be used with general questions concerning the C language, as defined in the ISO 9899 standard […]

Should a language tag only be used when the question included standardized features?

8
  • 4
    It is a never-ending battle between the purists and the pragmatists, a division created by the language standard being but a comprise that had to make everybody equally unhappy and every compiler having extensions to write practical programs. Avoid getting involved in that battle, you can't win. Commented Oct 9, 2018 at 10:54
  • 1
    @HansPassant never-ending battle --> Not really in SO C/C++ community, the purists overwhelmingly win. Just take a look at the fantastic tag language-lawyer, so many upvotes averagely no matter how useless most of them are in actual development. SO community is so obsessed in standard, as if the standard text is more important than development itself. The unfortunate thing is, this meta post can't change anything.
    – llllllllll
    Commented Oct 9, 2018 at 11:32
  • 3
    Hmya, the programmers that need help with their [c] or [c++] program are almost never purists. Just like compiler writers are not. They don't get much practical assistance from a finger-wagging community, the commenting tends to especially get out of hand badly. Didn't use to be that way, but the pragmatists got chased away. That one was especially sad btw. Commented Oct 9, 2018 at 11:43
  • 1
    Entirely non-serious suggestion: How about we create a pure-c tag? Then we can keep c on such questions and everyone can be happy. Commented Oct 9, 2018 at 12:17
  • 4
    @HansPassant After some reading I realized that deleted user is hvd, that's really unbelievable. The comment in that post about VS is as ridiculous as this one about gcc. I doubt some particular users actually write any non-trivial C/C++ program in their life, maybe standard reading is their job.
    – llllllllll
    Commented Oct 9, 2018 at 13:11
  • @liliscent I wouldn't call language-lawyer questions useless. When faced with two compilers disagreeing on the legality/meaning of something, I want to know which one is right in order to provide the proper condition for the pragmatic workaround (i.e. should I be doing #if GCC then workaround() or #if MSVC then workaround()?). As compilers improve or new compilers/platforms are added to a project, knowing that is important. I usually find it in the standard myself instead of asking here, but not everyone is well-versed in standardese, so for them a language-lawyer question is the way to go Commented Oct 12, 2018 at 10:12
  • @Angew Yeah, calling it "useless" might be a little too far. What I wanted to say in previous comments was the disproportionate focus on the standard I've observed here. As for compiler bugs, in my experience, they're usually only revealed from overuse of some obscure feature or introduce of artificial language complexities, which often could be avoided by more "natural" and explicit alternatives. But to exploit the power of C++ as much as possible, being a language-lawyer might be beneficial. That's kinda opinion-based.
    – llllllllll
    Commented Oct 12, 2018 at 15:10
  • @liliscent also "I doubt some particular users actually write any non-trivial C/C++ program in their life" is rude, who are you to judge people ?
    – Stargateur
    Commented Oct 16, 2018 at 3:27

2 Answers 2

22

In my view, the tag C is appropriate when the base language for the question is C.

It is appropriate to also tag the question with auxilliary tags such as GCC if asking about a GCC extension. If you are editing the question, it might be appropriate to add the auxilliary tag; it is not appropriate to remove the base language tag.

I've just been dealing with a question asking about strlcat(). It isn't a part of Standard C or POSIX, but it is widely available. It is perfectly OK (IMNSHO) to leave that question tagged with C and not worry about the fact that it's available on Linux and the *BSD systems (including macOS). Questions about the Windows API in C should be tagged with C and WinAPI (), but they're still C questions (mostly — when they're not really about C++).

As noted in the comments, the person asking the question is frequently not aware of the minutiae of where the function or feature comes from. That should not prevent them asking about it — Stack Overflow is where you can ask questions and get answers to them.

Removing the C tag from a question because it isn't about standard C (but is clearly about a dialect of C, rather than C++) is a hostile act — it is not friendly or welcoming, nor is it helpful. It won't get the question the exposure it deserves. I don't think people will try to guess what other tags to monitor than the base language; I know I don't often go searching for C questions other than via the C tag, for all I do monitor some extra tags, like or .

Where the question includes C++ code (#include <iostream> or similar), then it is appropriate to retag to C++ (see the recent discussion about Proposed update to C and C++ tag usage wikis) — but it isn't appropriate to remove the correct base language altogether.

I believe similar comments apply to C++. I won't pretend to pontificate on most other languages. I do note that the SQL tag requests the OP to also identify the DBMS on which the SQL should run because the standard language is not the same as any of the multitude of dialects for SQL.

2
  • 3
    "Removing the C tag from a question because it isn't about standard C [...] is a hostile act — it is not friendly or welcoming, nor is it helpful." Exactly.
    – KeithWM
    Commented Oct 12, 2018 at 10:13
  • I don't know two SQL service that are fully (at least for standard thing) compliant. They all want to be call SQL, even if no one follow the actual standard. That why put a SQL tag is not really useful without the information of what is the real service you use. C don't differ, if you happen to use a compiler who doesn't follow the C standard, the C tag don't provide useful information, it must be along with a other tag who specify the compiler you use. For exemple, c arduino.
    – Stargateur
    Commented Oct 16, 2018 at 3:43
4

The (now superseded, but that's what I have in easy HTML form) C11 standard says the following (C11 4p6-7):

[...] A conforming implementation may have extensions (including additional library functions), provided they do not alter the behavior of any strictly conforming program.

and

A conforming program is one that is acceptable to a conforming implementation.

A program that uses the GCC extension __attribute__ is a conforming C program, because it is acceptable by GCC.

Even with its __attribute__, GCC is a conforming implementation, because all identifiers that start with double underscore are reserved for the implementation for any use.

A would argue that this program very much is written in C and can and should be tagged with .

You must log in to answer this question.

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