https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
--- Comment #8 from Martin Sebor ---
I agree that GCC would do a better by running -Wshift-count-overflow later (but
that carries a risk of false positives as well). That's also why I
acknowledged the report.
Both solutions appear to be optimiz
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
--- Comment #7 from Scott ---
While that's brilliant,
1) I don't lack for ways to code around the problem, but whether or not
I do, g++ nonetheless has a problem here.
2) At a guess, the recursive solution is avoiding the warnings because
the
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
--- Comment #6 from Martin Sebor ---
The C++ solution to this kind of problem is to use template specialization.
It's a been a while since I wrote any real C++ code but this seems to work and
avoids the warnings
class PackRule
{
template
s
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
--- Comment #5 from Marc Glisse ---
(In reply to Martin Sebor from comment #2)
> The warning is not specific to C++ but triggers for C code as well
True, but C++ templates somehow make this different. In C, you could use the
preprocessor to test
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
--- Comment #4 from Scott ---
Um... yes, that would kill the warning; but then I'd be writing
/* The modulo operation is meaningless and will be optimized out, I
promise. It's here
because there's a specific compiler, g++ 7.3.0, that can't fig
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88895
Martin Sebor changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill