42Bastian Schick said:
Means, only the compiler or what comes with it should define
types with leading underscores ?
Means "the implementor" -- the guy writing your compiler and
surrounding code.
(Actually, IIRC I've seen in in some Linux source and found it
appealing.)
Suppose I, as your implementor, put this in <stdio.h> (contrary
to the standard's requirement that I do not do this):
#define i 42
#define tmp "ha ha"
Now you, the user, write your program, including a function:
#include <stdio.h>
...
void f(...) {
int i;
char *tmp;
...
When you go to compile this, the compiler "sees" the top of your
function f() written as:
int 42;
char *"ha ha";
and gives you a bunch of strange syntax error messages.
I, the implementor, keep out of you way by making sure I do this:
/* flags for __sflag field */
#define __SRD 1
#define __SWR 2
[etc]
You, the user, keep out of my way by not using names like "__SRD".
For the most part, all the names starting with "_" are mine, and
all the rest are yours. If I define "i" or "tmp", it is my fault
for breaking your code. If you define _ZOG, it is your fault for
breaking my code.
Now, what if you are neither the implementor, nor the end user?
What if you are the guy writing a library for doing graphics, or
playing chess, or whatever? What names do *you* get? (The
Standard answereth not.)