public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bruno at clisp dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/32024] New: sys/un.h includes header files within extern "C++" { ... }
Date: Fri, 26 Jul 2024 11:22:01 +0000	[thread overview]
Message-ID: <bug-32024-131@http.sourceware.org/bugzilla/> (raw)

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

            Bug ID: 32024
           Summary: sys/un.h includes header files within extern "C++" {
                    ... }
           Product: glibc
           Version: 2.40
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: bruno at clisp dot org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The <sys/un.h> header file includes other header files (<stddef.h> and
<string.h>) from within an extern "C++" { ... } block (written as __BEGIN_DECLS
and __END_DECLS).

While this has no ill effects with the glibc definitions of <stddef.h> and
<string.h>, it causes compilation errors when used with GNU Gnulib. Gnulib
augments <stddef.h> and <string.h> with additional declarations, by use of
#include_next. When these overridden header files are included from within an
extern "C++" { ... } block, with clang++, this leads to errors ("error:
declaration of 'memchr' has a different language linkage" etc.). See
<https://lists.gnu.org/archive/html/bug-gnulib/2024-07/msg00261.html>.

Find attached a fix, that moves the includes outside the extern "C++" { ... }
block.

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

             reply	other threads:[~2024-07-26 11:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26 11:22 bruno at clisp dot org [this message]
2024-07-26 11:25 ` [Bug libc/32024] " bruno at clisp dot org
2024-07-26 19:06 ` eblake at redhat dot com
2024-09-11 14:15 ` schwab@linux-m68k.org
2024-09-13 20:59 ` bruno at clisp dot org
2024-09-13 21:00 ` bruno at clisp dot org
2024-09-13 21:00 ` bruno at clisp dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-32024-131@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).