Ubuntu

bayonne FTBFS with g++-4.4: wrong prototype for strchr()

Reported by Steve Langasek on 2009-08-13
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bayonne (Ubuntu)
Undecided
StefanPotyra
eglibc (Ubuntu)
Medium
Unassigned

Bug Description

Binary package hint: gcc-4.4

bayonne FTBFS with g++-4.4 with this error:

sh ../libtool --tag=CXX --mode=compile x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/cc++2/ -fPIC -D__LINUX__ -g -O2 -D_GNU_SOURCE -c -o sysexec.lo sysexec.cpp
 x86_64-linux-gnu-g++ -DHAVE_CONFIG_H -I. -I. -I. -I/usr/include/cc++2/ -fPIC -D__LINUX__ -g -O2 -D_GNU_SOURCE -c sysexec.cpp -fPIC -DPIC -o .libs/sysexec.o
sysexec.cpp: In member function 'void ost::BayonneTSession::sysReplay(const char*, char*)':
sysexec.cpp:238: warning: format not a string literal and no format arguments
sysexec.cpp:238: warning: format not a string literal and no format arguments
sysexec.cpp: In member function 'void ost::BayonneTSession::sysTone(const char*, char*)':
sysexec.cpp:337: error: invalid conversion from 'const char*' to 'char*'
sysexec.cpp: In member function 'void ost::BayonneTSession::sysExit(const char*, char*)':
sysexec.cpp:675: warning: deprecated conversion from string constant to 'char*'

Line 337 of sysexec.cpp reads:

        p = strchr(tone, '/');

And strchr() is supposed to take a const char * as its first argument, so this isn't *supposed* to be a conversion. This is apparently a regression in g++-4.4, vs. g++-4.3 which can compile the code just fine.

ProblemType: Bug
Architecture: amd64
Date: Thu Aug 13 02:52:15 2009
DistroRelease: Ubuntu 9.10
Package: g++-4.4 4.4.1-1ubuntu3
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-5.24-generic
SourcePackage: gcc-4.4
Uname: Linux 2.6.31-5-generic x86_64

Related branches

Steve Langasek (vorlon) wrote :
Changed in gcc-4.4 (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Matthias Klose (doko) wrote :

this is unrelated to GCC, but is seen with glibc-2.10; see a diff of the preprocessed file (built with libc6-dev 2.9, vs built with 2.10.1)

-extern char *strchr (__const char *__s, int __c)
- throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

-extern char *strrchr (__const char *__s, int __c)
- throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern "C++"
+{
+extern char *strchr (char *__s, int __c)
+ throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+extern __const char *strchr (__const char *__s, int __c)
+ throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
+
+
+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) char *
+strchr (char *__s, int __c) throw ()
+{
+ return __builtin_strchr (__s, __c);
+}

+extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__, __artificial__)) __const char *
+strchr (__const char *__s, int __c) throw ()
+{
+ return __builtin_strchr (__s, __c);
+}

affects: gcc-4.4 (Ubuntu) → eglibc (Ubuntu)
Steve Langasek (vorlon) wrote :

Not a bayonne bug, for sure; bayonne is using the function as specified, it's eglibc 2.10+gcc-4.4 that's feeding it a wrong prototype.

Changed in bayonne (Ubuntu):
status: New → Invalid
Steve Langasek (vorlon) wrote :

No, I'm totally on crack and failed to notice that eglibc was providing two different prototypes with different *argument* types. This is definitely a bayonne bug, not a bug in gcc on eglibc.

Changed in eglibc (Ubuntu):
status: Triaged → Invalid
Changed in bayonne (Ubuntu):
status: Invalid → Triaged
assignee: nobody → Steve Langasek (vorlon)
StefanPotyra (sistpoty) wrote :

Really ugly make it compile with a hammer kind of patch. Compiles, but haven't tested the result yet.

StefanPotyra (sistpoty) wrote :

(am at work right now, so can't upload the patch myself before I get home)

StefanPotyra (sistpoty) on 2009-10-08
Changed in bayonne (Ubuntu):
assignee: Steve Langasek (vorlon) → StefanPotyra (sistpoty)
StefanPotyra (sistpoty) on 2009-10-08
Changed in bayonne (Ubuntu):
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bayonne - 2.3.2-3ubuntu1

---------------
bayonne (2.3.2-3ubuntu1) karmic; urgency=low

  * Add debian/patches gcc-4.4.dpatch to fix build failures with
    gcc-4.4 in conjunction with the newer eglibc (LP: #412933).

 -- Stefan Potyra <email address hidden> Thu, 08 Oct 2009 16:09:06 +0200

Changed in bayonne (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers