ro at gcc dot gnu.org
2018-09-17 13:48:36 UTC
https://sourceware.org/bugzilla/show_bug.cgi?id=23676
Bug ID: 23676
Summary: unittests/string_view-selftests.c doesn't compile with
-O0 on Solaris
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: ro at gcc dot gnu.org
Target Milestone: ---
Target: *-*-solaris2.*
In preparation for the proposed Solaris buildbots
https://sourceware.org/ml/gdb/2018-09/msg00004.html
I tried to build gdb master with the same flags used there (-g
-D_GLIBCXX_DEBUG).
This works except for a single file:
$ g++ -x c++ -g -D_GLIBCXX_DEBUG -m64 -I.
-I/vol/src/gnu/gdb/hg/master/dist/gdb
-I/vol/src/gnu/gdb/hg/master/dist/gdb/common
-I/vol/src/gnu/gdb/hg/master/dist/gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../include/opcode
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../opcodes/..
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../readline/..
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../zlib -I../bfd
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../bfd
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../include -I../libdecnumber
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../libdecnumber
-I/vol/src/gnu/gdb/hg/master/dist/gdb/gnulib/import -Ibuild-gnulib/import
-DTUI=1 -I/usr/include/python2.7 -I/usr/include/python2.7 -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
-Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond
-Wno-unknown-pragmas -Wno-deprecated-declarations -Werror -c -o
unittests/string_view-selftests.o -MT unittests/string_view-selftests.o -MMD
-MP -MF unittests/.deps/string_view-selftests.Tpo
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c
errors out with
In file included from /usr/include/sys/time.h:448,
from build-gnulib/import/sys/time.h:39,
from /usr/include/sys/select.h:27,
from /usr/include/sys/types.h:665,
from build-gnulib/import/sys/types.h:28,
from build-gnulib/import/stdio.h:58,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/common/common-defs.h:75,
from /vol/src/gnu/gdb/hg/master/dist/gdb/defs.h:28,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c:26:
build-gnulib/import/stdio.h:589:1: error: ‘int fgetc(std::FILE*)’ conflicts
with a previous declaration
_GL_CXXALIASWARN (fgetc);
^~~~~~~~~~~~~~~~
In file included from
/vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/stdio.h:75,
from build-gnulib/import/stdio.h:43,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/common/common-defs.h:75,
from /vol/src/gnu/gdb/hg/master/dist/gdb/defs.h:28,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c:26:
/usr/include/iso/stdio_iso.h:264:12: note: previous declaration ‘int
std::fgetc(std::FILE*)’
extern int fgetc(FILE *);
^~~~~
and many more. The first declaration is from gnulib (_GL_CXXALIASWARN
(fgetc)):
int fgetc(std::FILE*)
while the second one from <iso/stdio_iso.h> has:
int std::fgetc(std::FILE*)
The errors vanish at -O.
With -g3 -fpreprocessed, the following lines refer to fgetc:
extern int fgetc(FILE *);
using std::fgetc;
{ static const struct _gl_fgetc_wrapper { typedef int (*type) (FILE *stream);
inline type rpl () const { return ::fgetc; } inline operator type () const {
return rpl (); } } fgetc = {}; } extern "C" int _gl_cxxalias_dummy;
extern __typeof__ (fgetc) fgetc __attribute__ ((__warning__ ("The symbol ::"
"fgetc" " refers to the system function. " "Use " "gnulib" "::" "fgetc" "
instead.")));
#undef fgetc
using ::fgetc;
while with -O, the __warning__ line is gone; from
# 587 "build-gnulib/import/stdio.h" 3
This can be reproduced with
$ cat stdio.cc
#define GNULIB_NAMESPACE gnulib
#include "stdio.h"
$ g++ -g -Ibuild-gnulib/import -Wall -Werror -c stdio.cc
I'm a bit lost in that maze, unfortunately.
Bug ID: 23676
Summary: unittests/string_view-selftests.c doesn't compile with
-O0 on Solaris
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: build
Assignee: unassigned at sourceware dot org
Reporter: ro at gcc dot gnu.org
Target Milestone: ---
Target: *-*-solaris2.*
In preparation for the proposed Solaris buildbots
https://sourceware.org/ml/gdb/2018-09/msg00004.html
I tried to build gdb master with the same flags used there (-g
-D_GLIBCXX_DEBUG).
This works except for a single file:
$ g++ -x c++ -g -D_GLIBCXX_DEBUG -m64 -I.
-I/vol/src/gnu/gdb/hg/master/dist/gdb
-I/vol/src/gnu/gdb/hg/master/dist/gdb/common
-I/vol/src/gnu/gdb/hg/master/dist/gdb/config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../include/opcode
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../opcodes/..
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../readline/..
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../zlib -I../bfd
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../bfd
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../include -I../libdecnumber
-I/vol/src/gnu/gdb/hg/master/dist/gdb/../libdecnumber
-I/vol/src/gnu/gdb/hg/master/dist/gdb/gnulib/import -Ibuild-gnulib/import
-DTUI=1 -I/usr/include/python2.7 -I/usr/include/python2.7 -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
-Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond
-Wno-unknown-pragmas -Wno-deprecated-declarations -Werror -c -o
unittests/string_view-selftests.o -MT unittests/string_view-selftests.o -MMD
-MP -MF unittests/.deps/string_view-selftests.Tpo
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c
errors out with
In file included from /usr/include/sys/time.h:448,
from build-gnulib/import/sys/time.h:39,
from /usr/include/sys/select.h:27,
from /usr/include/sys/types.h:665,
from build-gnulib/import/sys/types.h:28,
from build-gnulib/import/stdio.h:58,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/common/common-defs.h:75,
from /vol/src/gnu/gdb/hg/master/dist/gdb/defs.h:28,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c:26:
build-gnulib/import/stdio.h:589:1: error: ‘int fgetc(std::FILE*)’ conflicts
with a previous declaration
_GL_CXXALIASWARN (fgetc);
^~~~~~~~~~~~~~~~
In file included from
/vol/gcc-8/lib/gcc/i386-pc-solaris2.11/8.1.0/include-fixed/stdio.h:75,
from build-gnulib/import/stdio.h:43,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/common/common-defs.h:75,
from /vol/src/gnu/gdb/hg/master/dist/gdb/defs.h:28,
from
/vol/src/gnu/gdb/hg/master/dist/gdb/unittests/string_view-selftests.c:26:
/usr/include/iso/stdio_iso.h:264:12: note: previous declaration ‘int
std::fgetc(std::FILE*)’
extern int fgetc(FILE *);
^~~~~
and many more. The first declaration is from gnulib (_GL_CXXALIASWARN
(fgetc)):
int fgetc(std::FILE*)
while the second one from <iso/stdio_iso.h> has:
int std::fgetc(std::FILE*)
The errors vanish at -O.
With -g3 -fpreprocessed, the following lines refer to fgetc:
extern int fgetc(FILE *);
using std::fgetc;
{ static const struct _gl_fgetc_wrapper { typedef int (*type) (FILE *stream);
inline type rpl () const { return ::fgetc; } inline operator type () const {
return rpl (); } } fgetc = {}; } extern "C" int _gl_cxxalias_dummy;
extern __typeof__ (fgetc) fgetc __attribute__ ((__warning__ ("The symbol ::"
"fgetc" " refers to the system function. " "Use " "gnulib" "::" "fgetc" "
instead.")));
#undef fgetc
using ::fgetc;
while with -O, the __warning__ line is gone; from
# 587 "build-gnulib/import/stdio.h" 3
This can be reproduced with
$ cat stdio.cc
#define GNULIB_NAMESPACE gnulib
#include "stdio.h"
$ g++ -g -Ibuild-gnulib/import -Wall -Werror -c stdio.cc
I'm a bit lost in that maze, unfortunately.
--
You are receiving this mail because:
You are on the CC list for the bug.
You are receiving this mail because:
You are on the CC list for the bug.