VTAILQ_EMPTY vs -Wparentheses-equality with clang
Dridi Boukelmoune
dridi at varni.sh
Mon Apr 4 15:46:37 CEST 2016
Hi,
As I said on IRC I have hit a bug while working on a VMOD and then on
Varnish itself. I thought I had seen other false-positives but that's
the only one, in several places.
Basically it complains when you use it in an if or while statement or
I suppose anything that expects a condition, because it interprets the
outer set of parentheses as a hint not to warn about assignment. So
we've gone full circle on this one!
Do we use this kind of condition in Varnish?
if ((var = expr))
If not I suggest we disable it in autogen.des, my workaround is to use gcc.
I haven't tried clang above 3.7.0, but basically it is _not_ looking
at preprocessed code, in which we obviously don't have the outer
parentheses:
if (VTAILQ_EMPTY(...))
make -k log attached.
Current Travis CI continuous integration uses clang 3.4 FYI.
Best Regards,
Dridi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-warnings.log
Type: text/x-log
Size: 5922 bytes
Desc: not available
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20160404/06921425/attachment.bin>
More information about the varnish-dev
mailing list