-----BEGIN PGP SIGNED MESSAGE-----
after finding a minor mistake in a header include file this week, I’ve
wanted to make sure that the GR header files have proper,
non-conflicting include guards.
So I want to open the discussion whether GR would want to change from
#ifndef-based include guards to #pragma once.
What I noticed is:
- there were 881 files that contained the classical
#endif /maybe some comment/
scheme in current master
- replacing these with #pragma once has not damaged anything (as far
as one simple make test can tell)
- one minor mis-#define was found only which I believe is very
reassuring for our overall code quality (1) (2).
I’ve created a script (3) that checks (4) whether c++ files follow the
classical include guard methodology, and replaces that with a #pragma
once. cmake && make && make test worked fine on the first run which
made me confident enough to push everything (changed headers and the
script) to a branch:
It would be great if people running other toolchains than I do
(gcc4.8.2/x86_64) would check if it breaks stuff.
If there is enough interest and consensus that we might want to switch
over to #pragma once (instead of just doing this “for testing purposes
only”), I think it’d be worthwhile to tackle things that stayed
untouched during automatic conversion:
- .t templates
- the newmod architecture
(1) see my pull request against master
(2) however, vocoder/gsm/config.h uses #ifndef CONFIG_H, which I think
is a little bit asking for trouble
(4) checking is done by running it through the C preprocessor once to
get rid of comments and check the first line against an #ifndef macro,
and a second time to check whether defining that macro causes the file
to semantically disappear.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----