This is probably more of a general programming question than an electronics question, but since this group encompasses embedded systems programming to some extent, I'll answer it here.
The C standard promises that code may use any syntactically-valid identifier without risk of conflict with any implementation-defined identifiers, provided that:
- The user code does not use
#include <name> syntax for any headers not defined by the standard.
- The identifier does not conflict with any that are mentioned in the standard as being associated with headers included using the aforementioned syntax.
- The identifier does not start with two underscores.
A standards-conforming compiler must allow a C program to declare a variable, function, or type named
bit. If a compiler itself were to define a
bit type, but user code tried to assign some other meaning to that name, the two usages would conflict; standards-compliant compilers are not allowed to have such conflicts with standards-conforming code.
__bit rather than
bit as the name for its own bit type, the compiler ensures that the name will not generate any impermissible conflict. While such a name might still conflict with a user-defined identifier of the same name, the standard would allow an implementation to do whatever it likes in case of a conflict involving such a name. Most compilers will refrain from doing anything totally evil (e.g. pretending to compile normally, but generating code which would do nothing but endlessly output "FRINK RULES!" to all attached UARTs), but the standard allows compiler authors to do whatever they want, with no restriction whatsoever, in case of such naming conflicts).