public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug server/26944] New: -Wstringop-truncation when building gdbserver (the in-process agent) with optimizations
@ 2020-11-25  2:22 simark at simark dot ca
  0 siblings, 0 replies; only message in thread
From: simark at simark dot ca @ 2020-11-25  2:22 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=26944

            Bug ID: 26944
           Summary: -Wstringop-truncation when building gdbserver (the
                    in-process agent) with optimizations
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: server
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

Building gdbserver with optimization fails:

$ g++ --version
g++ (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ make V=1
g++     -I. -I/home/simark/src/binutils-gdb/gdbserver
-I/home/simark/src/binutils-gdb/gdbserver/../gdb/regformats
-I/home/simark/src/binutils-gdb/gdbserver/..
-I/home/simark/src/binutils-gdb/gdbserver/../include
-I/home/simark/src/binutils-gdb/gdbserver/../gdb
-I/home/simark/src/binutils-gdb/gdbserver/../gnulib/import -I../gnulib/import
-I/home/simark/src/binutils-gdb/gdbserver/.. -I..   -pthread -Wall
-Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function
-Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter
-Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized
-Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough=3
-Wduplicated-cond -Wshadow=local -Wdeprecated-copy -Wdeprecated-copy-dtor
-Wredundant-move -Wmissing-declarations -Wmissing-prototypes
-Wstrict-null-sentinel -Wformat -Wformat-nonliteral -Werror -DGDBSERVER 
-DCONFIG_UST_GDB_INTEGRATION -Drpl_strerror_r=strerror_r -fPIC
-DIN_PROCESS_AGENT -fvisibility=hidden -g3 -O2 -fsanitize=address -c -o
tracepoint-ipa.o -MT tracepoint-ipa.o -MMD -MP -MF ./.deps/tracepoint-ipa.Tpo
/home/simark/src/binutils-gdb/gdbserver/tracepoint.cc
cc1plus: warning: command-line option ‘-Wmissing-prototypes’ is valid for
C/ObjC but not for C++
In file included from /usr/include/string.h:519,
                 from ../gnulib/import/string.h:41,
                 from
/home/simark/src/binutils-gdb/gdbserver/../gdbsupport/common-defs.h:95,
                 from /home/simark/src/binutils-gdb/gdbserver/server.h:22,
                 from /home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:19:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int init_named_socket(const char*)’ at
/home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:6902:11,
    inlined from ‘int gdb_agent_socket_init()’ at
/home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:6953:26,
    inlined from ‘void* gdb_agent_helper_thread(void*)’ at
/home/simark/src/binutils-gdb/gdbserver/tracepoint.cc:7204:41:
/usr/include/bits/string_fortified.h:106:34: error: ‘char*
__builtin_strncpy(char*, const char*, long unsigned int)’ output may be
truncated copying 107 bytes from a string of length 107
[-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos
(__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


I took a quick look, but I don't understand.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-25  2:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25  2:22 [Bug server/26944] New: -Wstringop-truncation when building gdbserver (the in-process agent) with optimizations simark at simark dot ca

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).