public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/2486] New: <netinet/in.h> does not compile in C++.  Patch with conventional fix available.
@ 2006-03-24 23:52 dank at kegel dot com
  2006-03-25  0:51 ` [Bug libc/2486] " dank at kegel dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dank at kegel dot com @ 2006-03-24 23:52 UTC (permalink / raw)
  To: glibc-bugs

This is a classic, longstanding bug in all versions of glibc
and many other C libraries.  The essence is that

struct ip_opts {
    ...
    char ip_opts[40]; 
    ...

is not legal C++.  The traditional way of fixing this is to
capitalize the first letter of the member when compiling for C++.
A patch which does this, and applies to all versions of glibc is at
http://www.pengutronix.de/software/ptxdist/patches-0.5.2/glibc-2.2.5/generic/glibc-2.2.5-ip_opts.patch

There have been repeated requests to fix this over the years,
but for some reason, nobody filed a glibc bug report before!
Here are a few old posts about the problem in general, and how it's
been fixed elsewhere:
http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=681
http://gcc.gnu.org/ml/gcc/2002-05/msg00791.html
http://www.cygwin.com/ml/ecos-patches/2002-06/msg00005.html
http://www.netbsd.org/cgi-bin/query-pr-single.pl?number=19880

So, time to apply this patch in glibc head (and to the head of
the 2.3 branch, if possible)?

-- 
           Summary: <netinet/in.h> does not compile in C++.  Patch with
                    conventional fix available.
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: dank at kegel dot com
                CC: glibc-bugs at sources dot redhat dot com


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

------- 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] 4+ messages in thread

* [Bug libc/2486] <netinet/in.h> does not compile in C++.  Patch with conventional fix available.
  2006-03-24 23:52 [Bug libc/2486] New: <netinet/in.h> does not compile in C++. Patch with conventional fix available dank at kegel dot com
@ 2006-03-25  0:51 ` dank at kegel dot com
  2006-03-25  0:52 ` dank at kegel dot com
  2006-03-25  1:18 ` mec at google dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dank at kegel dot com @ 2006-03-25  0:51 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From dank at kegel dot com  2006-03-25 00:51 -------
Minor detail: the only version of gcc in common use
that reports this error is gcc-2.95.3. 
The gcc296 shipped by Fedora does not report this error.
So perhaps this is only of interest to embedded system developers
and/or those who use ancient compilers.

I'm marking this bug WONTFIX for now; affected
developers can apply the patch. 

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


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

------- 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] 4+ messages in thread

* [Bug libc/2486] <netinet/in.h> does not compile in C++.  Patch with conventional fix available.
  2006-03-24 23:52 [Bug libc/2486] New: <netinet/in.h> does not compile in C++. Patch with conventional fix available dank at kegel dot com
  2006-03-25  0:51 ` [Bug libc/2486] " dank at kegel dot com
@ 2006-03-25  0:52 ` dank at kegel dot com
  2006-03-25  1:18 ` mec at google dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dank at kegel dot com @ 2006-03-25  0:52 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From dank at kegel dot com  2006-03-25 00:52 -------
Created an attachment (id=940)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=940&action=view)
Patch to make glibc's in.h compatible with gcc-2.95.3 and perhaps other C++
compilers.


-- 


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

------- 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] 4+ messages in thread

* [Bug libc/2486] <netinet/in.h> does not compile in C++.  Patch with conventional fix available.
  2006-03-24 23:52 [Bug libc/2486] New: <netinet/in.h> does not compile in C++. Patch with conventional fix available dank at kegel dot com
  2006-03-25  0:51 ` [Bug libc/2486] " dank at kegel dot com
  2006-03-25  0:52 ` dank at kegel dot com
@ 2006-03-25  1:18 ` mec at google dot com
  2 siblings, 0 replies; 4+ messages in thread
From: mec at google dot com @ 2006-03-25  1:18 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From mec at google dot com  2006-03-25 01:18 -------
Actually I think this is not a bug at all:

Older versions of gcc suppress the warning when compiling system header files.

Newer versions of gcc implement DR#80 for C++, which allows data fields to have
the same name as the class if the class does not have a user-declared constructor.

http://std.dkuug.dk/jtc1/sc22/wg21/docs/cwg_defects.html#80


-- 


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

------- 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] 4+ messages in thread

end of thread, other threads:[~2006-03-25  1:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-24 23:52 [Bug libc/2486] New: <netinet/in.h> does not compile in C++. Patch with conventional fix available dank at kegel dot com
2006-03-25  0:51 ` [Bug libc/2486] " dank at kegel dot com
2006-03-25  0:52 ` dank at kegel dot com
2006-03-25  1:18 ` mec at google 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).