This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [Patch] Fix MIPS build failure caused by -Werror=undef
- From: Steve Ellcey <sellcey at imgtec dot com>
- To: "Maciej W. Rozycki" <macro at linux-mips dot org>
- Cc: <libc-alpha at sourceware dot org>
- Date: Tue, 17 Feb 2015 10:01:07 -0800
- Subject: Re: [Patch] Fix MIPS build failure caused by -Werror=undef
- Authentication-results: sourceware.org; auth=none
- References: <04dee4c5-a06d-447e-8174-ab39f52a4b48 at BAMAIL02 dot ba dot imgtec dot org> <alpine dot LFD dot 2 dot 11 dot 1502140537270 dot 11294 at eddie dot linux-mips dot org>
- Reply-to: <sellcey at imgtec dot com>
On Sat, 2015-02-14 at 14:33 +0000, Maciej W. Rozycki wrote:
> > diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h
> > index 9586104..43ce009 100644
> > --- a/sysdeps/mips/bits/endian.h
> > +++ b/sysdeps/mips/bits/endian.h
> > @@ -5,7 +5,7 @@
> > # error "Never use <bits/endian.h> directly; include <endian.h> instead."
> > #endif
> >
> > -#if __MIPSEB
> > +#ifdef __MIPSEB
> > # define __BYTE_ORDER __BIG_ENDIAN
> > #endif
> > #if __MIPSEL
>
> ^^^^^^^^^^^^
> Don't we need a complementing change for __MIPSEL here then too?
>
> Maciej
You are right. Apparently, this header is not actually used in the
glibc build since it didn't cause a build failure but we should fix it
so it doesn't cause an error/warning for users who do include the header
file. I will check this in as an obvious fix:
2015-02-17 Steve Ellcey <sellcey@imgtec.com>
* sysdeps/mips/bits/endian.h (__MIPSEL): Use #ifdef instead of #if.
diff --git a/sysdeps/mips/bits/endian.h b/sysdeps/mips/bits/endian.h
index 43ce009..92e97c7 100644
--- a/sysdeps/mips/bits/endian.h
+++ b/sysdeps/mips/bits/endian.h
@@ -8,6 +8,6 @@
#ifdef __MIPSEB
# define __BYTE_ORDER __BIG_ENDIAN
#endif
-#if __MIPSEL
+#ifdef __MIPSEL
# define __BYTE_ORDER __LITTLE_ENDIAN
#endif