https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85874

            Bug ID: 85874
           Summary: gcc points to wrong location when displaying error
           Product: gcc
           Version: 8.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asn at samba dot org
  Target Milestone: ---

Created attachment 44163
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44163&action=edit
debug.i

Compiling the latest upstream Samba with -O3, -Werror, among other flags, fails
but doesn't point to the correct error location.  The line it's giving us
doesn't make any sense for the error printed.


Below is the failing command and error messages.

gcc -O3 -g -ggdb -Wstrict-overflow -Wall -Wcomment -Wpointer-arith -Wcast-align
-Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wdeclaration-after-statement -fstrict-aliasing -DDEVELOPER -DDEBUG_PASSWORD
-fPIC -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -fstack-protector -Wshadow
-Wcast-qual -fno-common -Werror=address -Werror=strict-prototypes
-Werror=write-strings -Werror-implicit-function-declaration
-Werror=pointer-arith -Werror=declaration-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.. -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 -o default/lib/util/debug_11.o
../lib/util/debug.c: In function ‘debug_parse_levels’:
../lib/util/debug.c:788: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

Reply via email to