[pacman-dev] [RFC, PATCHES]: Very preliminary work towards clean build with clang -Weverything

Martin Kühne mysatyre at gmail.com
Sat Sep 3 08:49:07 UTC 2016


All identifiers that begin with an underscore and either an uppercase
letter or another underscore are always reserved for any use.
All identifiers that begin with an underscore are always reserved for
use as identifiers with file scope in both the ordinary and tag
name spaces. (ISO 9899:1999, 7.1.3) Don't use such identifiers.

As a matter of fact, typedefs, struct names and function names fall
under this terminology. Despite the fact that the compiler accepts
leading underscores, per standard they are explicitly discouraged.
So, what we should consider is to move _alpm_errno_t along with all
other names in the source tree away from leading underscores. Their
visibility should be controlled by the presence of a static keyword,
-fvisibility and such instead.

You might want to write a sed script for this, and it looks like a
major invasion into the codebase. The last word is with the
developers, though, hence I'm not sure this is going to be accepted
for traditional reasons.

cheers!
mar77i


More information about the pacman-dev mailing list