public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/10416] New: bug-atexit3-lib.cc build failure with g++ 4.5.0 (and fix)
@ 2009-07-19 20:26 dps at simpson dot demon dot co dot uk
  2009-07-23 19:40 ` [Bug libc/10416] " drepper at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: dps at simpson dot demon dot co dot uk @ 2009-07-19 20:26 UTC (permalink / raw)
  To: glibc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2565 bytes --]

When checking gcc using g++ to compile bug-atexit3-lib.cc produces

In file included from bug-atexit3-lib.cc:1:0:
../include/unistd.h:4:1: error: new declaration ‘void _exit(int)’
../posix/unistd.h:570:13: error: ambiguates old declaration ‘void _exit(int)’
../include/unistd.h:7:1: error: new declaration ‘int execl(const char*, const
char*, ...)’
../posix/unistd.h:540:12: error: ambiguates old declaration ‘int execl(const
char*, const char*, ...)’
../include/unistd.h:8:1: error: new declaration ‘int execle(const char*, const
char*, ...)’
../posix/unistd.h:535:12: error: ambiguates old declaration ‘int execle(const
char*, const char*, ...)’
../include/unistd.h:9:1: error: new declaration ‘int execlp(const char*, const
char*, ...)’
../posix/unistd.h:551:12: error: ambiguates old declaration ‘int execlp(const
char*, const char*, ...)’
../include/unistd.h:10:1: warning: ‘int execvp(const char*, char* const*)’:
visibility attribute ignored because it
../posix/unistd.h:545:12: warning: conflicts with previous declaration here

This seems to be extern "C" version in posix/unistd.h being ambiguous with the
not extern "C" version in include/unistd.h. This presumably affects a wide range
of target architecture and many C++ compilers. 

The fix below fixes this by adding bracketing the contents of unistd.h in
_BEGIB_DECLS ... __END_DECLS.

--- include/unistd.h.dist       2009-07-19 17:22:48.160507246 +0100
+++ include/unistd.h    2009-07-19 20:06:03.857739225 +0100
@@ -1,6 +1,9 @@
 #ifndef _UNISTD_H
+# include <features.h>
 # include <posix/unistd.h>
 
+__BEGIN_DECLS
+
 libc_hidden_proto (_exit, __noreturn__)
 libc_hidden_proto (alarm)
 libc_hidden_proto (confstr)
@@ -174,4 +177,6 @@
    unless it is really necessary.  */
 #define __have_pipe2 __have_sock_cloexec
 
+__END_DECLS
+
 #endif

-- 
           Summary: bug-atexit3-lib.cc build failure with g++ 4.5.0 (and
                    fix)
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: dps at simpson dot demon dot co dot uk
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=10416

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug libc/10416] bug-atexit3-lib.cc build failure with g++ 4.5.0 (and fix)
  2009-07-19 20:26 [Bug libc/10416] New: bug-atexit3-lib.cc build failure with g++ 4.5.0 (and fix) dps at simpson dot demon dot co dot uk
@ 2009-07-23 19:40 ` drepper at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: drepper at redhat dot com @ 2009-07-23 19:40 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2009-07-23 19:39 -------
Applied.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=10416

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-23 19:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-19 20:26 [Bug libc/10416] New: bug-atexit3-lib.cc build failure with g++ 4.5.0 (and fix) dps at simpson dot demon dot co dot uk
2009-07-23 19:40 ` [Bug libc/10416] " drepper at redhat dot com

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).