Bug 13447 - gcc-8 on opensuse tumbleweed fails to build lib/util/debug.c with --picky-developer and -O3
Summary: gcc-8 on opensuse tumbleweed fails to build lib/util/debug.c with --picky-dev...
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-22 14:30 UTC by Jim McDonough
Modified: 2018-05-22 14:34 UTC (History)
1 user (show)

See Also:


Attachments
.i file from building lib/util/debug.c (220.43 KB, text/plain)
2018-05-22 14:30 UTC, Jim McDonough
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jim McDonough 2018-05-22 14:30:31 UTC
Created attachment 14213 [details]
.i file from building lib/util/debug.c

The following command fails:

gcc-8 -O3 -DDEVELOPER -DDEBUG_PASSWORD -fPIC -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -fstack-protector -g -Wall -Wshadow -Wmissing-prototypes -Wcast-align -Wcast-qual -fno-common -Werror=address -Werror=strict-prototypes -Wstrict-prototypes -Werror=write-strings -Wwrite-strings -Werror-implicit-function-declaration -Werror=pointer-arith -Wpointer-arith -Werror=declaration-after-statement -Wdeclaration-after-statement -Werror=return-type -Wreturn-type -Werror=uninitialized -Wuninitialized -Wimplicit-fallthrough -Werror=strict-overflow -Wstrict-overflow=2 -Wformat=2 -Wno-format-y2k -Wno-format-zero-length -Werror=format-security -Wformat-security -Werror=format -Werror -Wno-error=deprecated-declarations -Wno-error=tautological-compare -DSTATIC_samba_debug_MODULES=NULL -DSTATIC_samba_debug_MODULES_PROTO="extern void __samba_debug_dummy_module_proto(void)" -MD -Idefault/include/public -I../include/public -Idefault/source4 -I../source4 -Idefault/lib -I../lib -Idefault/source4/lib -I../source4/lib -Idefault/source4/include -I../source4/include -Idefault/include -I../include -Idefault/lib/replace -I../lib/replace -Idefault -I.. -Idefault/lib/talloc -I../lib/talloc -I/usr/local/include -D_SAMBA_BUILD_=4 -DHAVE_CONFIG_H=1 -D_GNU_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 ../lib/util/debug.c -c -save-temps -o default/lib/util/debug_11.o

../lib/util/debug.c: In function 'debug_parse_levels':
../lib/util/debug.c:796:5: error: assuming pointer wraparound does not occur when comparing P +- C1 with P +- C2 [-Werror=strict-overflow]
 bool debug_parse_levels(const char *params_str)
     ^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Comment 1 Andreas Schneider 2018-05-22 14:34:22 UTC
gcc 8.x needs to be fixed to point us to the correct line in the code. The function declaration doesn't do any pointer arithmetic.