[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add new macro gl_WARN_ADD_MULTIPLE
From: |
Bruno Haible |
Subject: |
Re: Add new macro gl_WARN_ADD_MULTIPLE |
Date: |
Thu, 02 May 2019 10:16:21 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-141-generic; KDE/5.18.0; x86_64; ; ) |
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)?
Bruno