On 5/2/19 10:16 AM, Bruno Haible wrote:
> Hi Alex,
> 
>> GNU Emacs spends about ~6s out of ~28s in its configuration process to
>> determine supported C compiler warnings.
> 
> It's good that you tackle this problem. Thanks!
> 
>> This macro first checks if all the supplied warnings are
>> supported, and then only checks them individually (via gl_WARN_ADD) if
>> that check fails.
> 
> So, the speed improvement exists only for the newest compilers; people
> who use a compiler that was released 1 or 2 years before the Emacs release
> will see no improvement.
> 
> How about a modified algorithm?
>   1) In a first pass, use the GCC's --help=warnings output to determine which
>      warnings are likely supported. Unfortunately, for clang, I don't know
>      of such a help option.
>   2) When the first check (with all the options) fails, split that list into
>      2 (or 3, or 4) chunks of nearly equal size, and perform the check
>      on each sub-list. And so on, recurse.
>      This way, you would still get some performance benefit if the compiler
>      supports 80% of the requested warnings but not all of them.
> 
> Finally, since there is no semantic difference between gl_WARN_ADD and
> gl_WARN_ADD_MULTIPLE, except that the latter allows multiple options, how
> about extending the gl_WARN_ADD macro (to allow multiple options) instead
> of defining a different macro (gl_WARN_ADD_MULTIPLE)?

Mentioned 2 years ago (but being still too busy to make a gnulib module
from it); Wget2's implementation using --help=warnings is here and FSF
copyrighted:

https://gitlab.com/gnuwget/wget2/blob/master/m4/wget_manywarnings.m4

And how to use / fine-tune it can be seen in L106 of

https://gitlab.com/gnuwget/wget2/blob/master/configure.ac

There is gcc and clang support. The configure.ac creates two sets of
compiler flags, for wget2/libwget sources and for gnulib sources.

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to