Mats Kindahl <mats@stripped> writes:
> I have a proposal for rules regarding the naming and usage of include guard. I
> see currently in the code include guards missing, but also used in odd ways that
> makes it more difficult to automatically check header files for missing include
> - Include guards shall be of the form ``PACKAGE_HEADER_INCLUDED``,
> that is: the package name followed by the base file name (excluding
> the extension) in all capital letters, numbers, and underscores. The
> package name and the header name is separated by an underscore.
> The extension is omitted because there are different naming
> conventions (.h, .hh, .hpp) and the choice of naming convention for
> header files should not affect the include guard name.
$ find . -name '*.h' -o -name '*.hpp' -o -name '*.ic' | xargs egrep '^#define.*_H'|wc -l
$ find . -name '*.h' -o -name '*.hpp' -o -name '*.ic' | xargs egrep
Please do not change the existing code style without good reason. Clearly the
current style is using _H, not _INCLUDED, and _H will be as easy for
developers to undestand as _INCLUDED, no matter the name of the file.
So let's keep PACKAGE_HEADER_H, please?