powa-team / pg_qualstats

A PostgreSQL extension for collecting statistics about predicates, helping find what indices are missing
Other
272 stars 26 forks source link

clang reports warnings on debian stretch #22

Closed anayrat closed 6 years ago

anayrat commented 6 years ago

Hello,

I build pg_qualstats ont debian stretch which use clang. clan reports severals warnings:

pg_qualstats.c:1520:27: warning: equality comparison with extraneous parentheses
      [-Wparentheses-equality]
                                if ((boolexpr->boolop == AND_EXPR))
                                     ~~~~~~~~~~~~~~~~~^~~~~~~~~~~
pg_qualstats.c:1520:27: note: remove extraneous parentheses around the comparison to silence this
      warning
                                if ((boolexpr->boolop == AND_EXPR))
                                    ~                 ^          ~
pg_qualstats.c:1520:27: note: use '=' to turn this equality comparison into an assignment
                                if ((boolexpr->boolop == AND_EXPR))
                                                      ^~
pg_qualstats.c:1755:14: warning: address of array 'entry->constvalue' will always evaluate to 'true'
      [-Wpointer-bool-conversion]
                if (entry->constvalue)
                ~~  ~~~~~~~^~~~~~~~~~

https://github.com/powa-team/pg_qualstats/pull/21 fix first message.

For the second message I don't know what to do.

rjuju commented 6 years ago

I just pushed https://github.com/powa-team/pg_qualstats/commit/e599d87c8889539ef6d97d5e910c2168f223ec64 to fix the second one.

Thanks for the report!