warning errors with buildworld with llvm39

From: Matthew Macy <mmacy_at_nextbsd.org>
Date: Tue, 30 Aug 2016 17:54:53 -0700
I did a buildworld with llvm39. Unsurprisingly I had to pass NO_WERROR= as the llvm has added additional warnings since 3.8.

https://gist.github.com/mattmacy/5f0c994b7587a10e3f58e7fd9fc1dd01


The most prevalent seems to be:

jemalloc_nstime.c:120:7: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#elif JEMALLOC_CLOCK_GETTIME
      ^
/mnt/storage/mmacy/devel/drm-next-merge/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/nstime.h:4:32: note: expanded from macro 'JEMALLOC_CLOCK_GETTIME'
#define JEMALLOC_CLOCK_GETTIME defined(_POSIX_MONOTONIC_CLOCK) \
                               ^
1 warning generated.
jemalloc_nstime.c:120:7: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
#elif JEMALLOC_CLOCK_GETTIME
      ^
/mnt/storage/mmacy/devel/drm-next-merge/lib/libc/../../contrib/jemalloc/include/jemalloc/internal/nstime.h:4:32: note: expanded from macro 'JEMALLOC_CLOCK_GETTIME'
#define JEMALLOC_CLOCK_GETTIME defined(_POSIX_MONOTONIC_CLOCK) \

It makes sense that a define in a define has undefined behavior because it requires a second evaluation by the C preprocessor.



I think constant-conversion warnings are also new:

/mnt/storage/mmacy/devel/drm-next-merge/lib/ncurses/ncursesw/../../../contrib/ncurses/ncurses/tinfo/lib_baudrate.c:121:5: warning: implicit conversion from 'int' to 'short' changes value from 38400 to -27136 [-Wconstant-conversion]
    DATA(38400),
    ^~~~~~~~~~~
/mnt/storage/mmacy/devel/drm-next-merge/lib/ncurses/ncursesw/../../../contrib/ncurses/ncurses/tinfo/lib_baudrate.c:97:24: note: expanded from macro 'DATA'
#define DATA(number) { B##number, number }
                     ~ ^~~~~~~~~
<scratch space>:30:1: note: expanded from here
B38400
^~~~~~
/home/mmacy/devel/build/mnt/storage/mmacy/devel/drm-next-merge/tmp/usr/include/sys/_termios.h:193:16: note: expanded from macro 'B38400'
#define B38400  38400
                ^~~~~
/mnt/storage/mmacy/devel/drm-next-merge/lib/ncurses/ncursesw/../../../contrib/ncurses/ncurses/tinfo/lib_baudrate.c:126:5: warning: implicit conversion from 'int' to 'short' changes value from 57600 to -7936 [-Wconstant-conversion]
    DATA(57600),
    ^~~~~~~~~~~
/mnt/storage/mmacy/devel/drm-next-merge/lib/ncurses/ncursesw/../../../contrib/ncurses/ncurses/tinfo/lib_baudrate.c:97:24: note: expanded from macro 'DATA'
#define DATA(number) { B##number, number }
                     ~ ^~~~~~~~~
<scratch space>:31:1: note: expanded from here
B57600
Received on Tue Aug 30 2016 - 22:54:59 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:07 UTC