Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_user.c:244:26: warning: the comparison will always evaluate as ‘true’ #64

Open
df7cb opened this issue Aug 17, 2022 · 0 comments

Comments

@df7cb
Copy link
Contributor

df7cb commented Aug 17, 2022

Compiler warning from clang 14 on Debian unstable:

make[1]: Verzeichnis „/home/cbe/projects/postgresql/set-user/set-user“ wird betreten
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -g -O2 -ffile-prefix-map=/home/cbe/projects/postgresql/set-user/set-user=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o set_user.o set_user.c
/usr/bin/clang-14 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -O2  -I. -I./ -I/usr/include/postgresql/14/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o set_user.bc set_user.c
set_user.c: In function ‘set_user’:
set_user.c:244:26: warning: the comparison will always evaluate as ‘true’ for the address of ‘data’ will never be NULL [-Waddress]
  244 |                 else if (!NameStr(procStruct->proname))
      |                          ^
In file included from /usr/include/postgresql/14/server/postgres.h:46,
                 from set_user.c:28:
/usr/include/postgresql/14/server/c.h:677:25: note: ‘data’ declared here
  677 |         char            data[NAMEDATALEN];
      |                         ^~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant