On 08/13/2018 11:30 AM, Niels Möller wrote:
Tim Rühsen tim.ruehsen@gmx.de writes:
#defines should not start with an underscore. C standards say this is reserved (for system headers !?) and some static analyzers complain about it.
Note that Nettle has violated this rule since the very beginnings. E.g,
#define _MD5_DIGEST_LENGTH 4
has been in md5.h since the initial commit (back in April 2001, around midnight). I haven't seen any reports about this causing problems.
I agree it's not quite right, and maybe we should clean this up at some point, replacing the leading underscore by nettle_internal_ (or maybe trailing underscore or nettle__ (double underscore). But not now.
Which static analyzers complain?
AFAIR it was lgtm.com complaining the header guards in libpsl (which I meanwhile changed to not use leading underscores).
And you are right, I also have never experienced any problems with such defines. Except that people keep complaining about not following the standards ;-)
Getting automated static analyzers to 0 issues has the nice side-effect that you can fail your CI / build when 1+ issue pops up. So any contributor is (automatically) forced to deliver clean code. That takes some burden from the maintainer and reduces iteration / discussions about certain kind of 'cleanups'.
So nothing serious that needs to be addressed immediately.
Regards, Tim