This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/18957] New: Error: static declaration of setns follows non-static declaration


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

            Bug ID: 18957
           Summary: Error: static declaration of setns follows non-static
                    declaration
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dcollinsn at gmail dot com
  Target Milestone: ---

Greetings,

While compiling GDB 7.10 on the following system:

dcollins@****~$ uname -a
Linux **** 2.6.32-5-686 #1 SMP Tue May 13 16:33:32 UTC 2014 i686 GNU/Linux

With toolchain versions:
GCC 5.2.0
glibc 2.22
binutils 2.25

by executing the following commands:
./Configure && make

I received the following error:

gcc -g -O2   -I. -I. -I./common -I./config
-DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode
-I./../opcodes/.. -I./../readline/.. -I./../zlib -I../bfd -I./../bfd
-I./../include -I../libdecnumber -I./../libdecnumber  -I./gnulib/import
-Ibuild-gnulib/import    -Wall -Wpointer-arith -Wno-unused -Wunused-value
-Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wpointer-sign
-Wmissing-prototypes -Wdeclaration-after-statement -Wmissing-parameter-type
-Wold-style-declaration -Wold-style-definition -Wformat-nonliteral  -c -o
linux-namespaces.o -MT linux-namespaces.o -MMD -MP -MF
.deps/linux-namespaces.Tpo ./nat/linux-namespaces.c
./nat/linux-namespaces.c:39:1: error: static declaration of âsetnsâ follows
non-static declaration
 setns (int fd, int nstype)
 ^
In file included from /usr/include/sched.h:43:0,
                 from ./nat/linux-namespaces.c:30:
/usr/include/bits/sched.h:91:12: note: previous declaration of âsetnsâ was here
 extern int setns (int __fd, int __nstype) __THROW;
            ^
make[2]: *** [linux-namespaces.o] Error 1
make[2]: Leaving directory `/home/dcollins/gdb-7.10/gdb'
make[1]: *** [all-gdb] Error 2
make[1]: Leaving directory `/home/dcollins/gdb-7.10'
make: *** [all] Error 2

Modifying line 38 of gdb/nat/linux-namespaces.c to remove the static
declaration allowed compilation to continue without error. GDB Configure should
determine whether the preexisting setns is declared with or without static and
should follow that convention to prevent this compile error.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]