set_user icon indicating copy to clipboard operation
set_user copied to clipboard

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

Open df7cb opened this issue 1 year ago • 0 comments

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];
      |                         ^~~~

df7cb avatar Aug 17 '22 11:08 df7cb