[squid-dev] RFC: policy change for header #includes
Francesco Chemolli
gkinkie at gmail.com
Tue Mar 7 09:14:44 UTC 2023
I like this idea; I would also complement it with the directive to use
header <cXXXXX> instead of <XXXXX.h> whenever possible - this could also be
automatically enforced
On Tue, Mar 7, 2023 at 5:38 AM Amos Jeffries <squid3 at treenet.co.nz> wrote:
>
> Current Policy
> <
> https://wiki.squid-cache.org/DeveloperResources/SquidCodingGuidelines#file-include-guidelines
> >:
> "
> 4. system C headers (with a .h suffix):
> * mandatory HAVE_FOO_H wrapper
> "
>
>
> I propose using the C++17 "__has_include(<foo.h>)" instead of HAVE_FOO_H
> whenever we can. Which is:
> * all .cc and .cci files
> * any .h files in the src/ and tools/ areas
>
>
> Pros:
> * less configure.ac logic, smaller build logs
> * removes need to do a full bootstrap + re-configure when a
> third-party library or system header is added/remove/changed
> * conversion can be semi-scripted
>
> Cons AFAIK are all about how it cannot be a blanket requirement like
> HAVE_FOO_H is:
> * sometimes headers need to be forbidden include by ./configure logic
> checks
> * C language does not support the __has_include
>
>
> Cheers
> Amos
>
> _______________________________________________
> squid-dev mailing list
> squid-dev at lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev
>
--
Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20230307/5cd1d466/attachment.htm>
More information about the squid-dev
mailing list