bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Merge glibc ieee128 ldbl redirect support into cdefs.h


From: Bruno Haible
Subject: Re: [PATCH] Merge glibc ieee128 ldbl redirect support into cdefs.h
Date: Tue, 05 Jan 2021 02:06:35 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; )

Paul E Murphy wrote:
> >> The missing macro is provided by glibc's cdefs.h.  Thus, the wrong
> >> cdefs.h was picked up.
> > 
> > The one from glibc is meant to be included when someone writes
> >    #include <sys/cdefs.h>
> > 
> > The one from Gnulib is meant to be included when someone writes
> >    #include <cdefs.h>
> > via
> >    #include <libc-config.h>
> > 
> > If the wrong one was picked up, it sounds you have too many -I options
> > in your compilation commands.
> > 
> 
> Oops, the trace I posted wasn't complete.  Here it is in it's full form. 

This error trace won't help you here. What you need, is to run the
compilation command (which failed) with option -E instead of with options
"-c -o OUTPUT.o", and pipe the output into a file...

I see the problem now: glibc's <sys/cdefs.h> and Gnulib's <cdefs.h> have
the same include guard!

It could be that this patch leads to "redefined macro" warnings. But these
would be better than not having macros included that the system headers
(e.g. <stdio.h> in Paul Murphy's case) rely upon.


2021-01-04  Bruno Haible  <bruno@clisp.org>

        libc-config: Avoid overriding the headers from an installed newer glibc.
        Reported by Paul E Murphy <murphyp@linux.ibm.com> in
        <https://lists.gnu.org/archive/html/bug-gnulib/2020-12/msg00106.html>.
        * lib/cdefs.h: Use a different include guard than glibc's <sys/cdefs.h>.

diff --git a/lib/cdefs.h b/lib/cdefs.h
index 6b1cf23..fd72b7b 100644
--- a/lib/cdefs.h
+++ b/lib/cdefs.h
@@ -15,8 +15,8 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef        _SYS_CDEFS_H
-#define        _SYS_CDEFS_H    1
+#ifndef        _GL_CDEFS_H
+#define        _GL_CDEFS_H     1
 
 /* We are almost always included from features.h. */
 #ifndef _FEATURES_H
@@ -545,4 +545,4 @@
 # define __HAVE_GENERIC_SELECTION 0
 #endif
 
-#endif  /* sys/cdefs.h */
+#endif  /* gnulib cdefs.h */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]