[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Recursive macro?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Recursive macro? |
Date: |
Sun, 10 Jul 2022 00:28:56 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 |
On 7/9/22 16:31, Vadim Zeitlin wrote:
> On Fri, 8 Jul 2022 02:27:04 +0000 Greg Chicares <gchicares@sbcglobal.net>
> wrote:
>
> GC> In file included from /opt/lmi/src/lmi/regex_test.cpp:29:
> GC> /opt/lmi/src/lmi/pcre_regex.hpp:256:31: error: disabled expansion of
> recursive macro [-Werror,-Wdisabled-macro-expansion]
> GC> (reinterpret_cast<PCRE2_SPTR>(pattern.data())
> GC> ^
> GC> /usr/include/pcre2.h:806:50: note: expanded from macro 'PCRE2_SPTR'
> GC> #define PCRE2_SPTR PCRE2_SUFFIX(PCRE2_SPTR)
> GC> ^
[... snip patch ...]
> FWIW this looks like a compiler bug to me, but, whether it is or not, I
> don't see what else could we possibly do about it, if we want to enable
> this warning.
Applied. Thanks. That's the only file that this warning complains about,
so I'd rather enable the warning and use a pragma to exempt this case.
In a thread that asks whether the warning is ever useful, this message:
https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20121029/067091.html
gives an example where it was considered useful. The link in that message
is invalid; here's a replacement that works today:
-
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20111226/050687.html
+ https://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20111226/050687.html
(It's not the most compelling use case IMO, but it's not nonsense either.)
Earlier in that thread is a fascinating discussion of '-Weverything'.
Some of TPTB chez clang profess astonishment that people are using it
routinely. I think it's a feature that turned out to be far more useful
than its designers hoped. In 'compiler_*_warnings.make', for C++ I
disable twenty-seven clang warnings (fewer, soon, I hope), but enable
one hundred five gcc warnings (more, with the next gcc version, I hope).