diff mbox

Remove PRI_MACROS_BROKEN define usage

Message ID 532B3168.2030108@linux.vnet.ibm.com
State New
Headers show

Commit Message

Adhemerval Zanella March 20, 2014, 6:20 p.m. UTC
Continuing on cleaning up the -Wundef warnings on glibc, this patch
focus on PRI_MACROS_BROKEN define. It is not defined in anywhere in
GLIBC source neither in any configure macro.

Checking on Internet I would say it is an artifact from GNULIB:
http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/inttypes-pri.m4;h=00251e1dbf487ceaf58c48c925da23312bee5cf4;hb=HEAD
And from comments it only happens on some ancient and non supported
system (AIX 4.3). So I think it is safe to just get rid of it.

--

2014-03-20  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>

	* intl/loadmsgcat.c (PRI_MACROS_BROKEN): Remove unused conditional.

---

Comments

Joseph Myers March 20, 2014, 6:35 p.m. UTC | #1
On Thu, 20 Mar 2014, Adhemerval Zanella wrote:

> 2014-03-20  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
> 
> 	* intl/loadmsgcat.c (PRI_MACROS_BROKEN): Remove unused conditional.

I think this file comes from GNU gettext (though we're long out of sync 
with gettext's copy of libintl - still, coordinating with gettext on how 
to avoid -Wundef warnings might be a good idea, as we'd like to end up 
with identical sources for shared files).  Defining PRI_MACROS_BROKEN to 0 
if _LIBC would be a conservative approach to keeping down divergence, if 
PRI_MACROS_BROKEN is still considered relevant in the gettext context.

http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/loadmsgcat.c
Adhemerval Zanella March 20, 2014, 6:45 p.m. UTC | #2
On 20-03-2014 15:35, Joseph S. Myers wrote:
> On Thu, 20 Mar 2014, Adhemerval Zanella wrote:
>
>> 2014-03-20  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
>>
>> 	* intl/loadmsgcat.c (PRI_MACROS_BROKEN): Remove unused conditional.
> I think this file comes from GNU gettext (though we're long out of sync 
> with gettext's copy of libintl - still, coordinating with gettext on how 
> to avoid -Wundef warnings might be a good idea, as we'd like to end up 
> with identical sources for shared files).  Defining PRI_MACROS_BROKEN to 0 
> if _LIBC would be a conservative approach to keeping down divergence, if 
> PRI_MACROS_BROKEN is still considered relevant in the gettext context.
>
> http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/loadmsgcat.c
>
Do we still want to keep code that no longer makes sense in our context? GLIBC does
not even have configure check for PRI_MACROS_BROKEN, so should we keep aiming
a possible sync? I personally aim for simplicity and maintainability in this
case, which means get rid of legacy code that does not make sense for GLIBC.
Joseph Myers March 20, 2014, 6:51 p.m. UTC | #3
On Thu, 20 Mar 2014, Adhemerval Zanella wrote:

> Do we still want to keep code that no longer makes sense in our context? 
> GLIBC does not even have configure check for PRI_MACROS_BROKEN, so 
> should we keep aiming a possible sync? I personally aim for simplicity 
> and maintainability in this case, which means get rid of legacy code 
> that does not make sense for GLIBC.

We want all files shared with other projects to be identical with the 
copies in those projects as far as possible (there may sometimes be cases 
where license notices need to be different, as with the files from GMP), 
to facilitate merging in both directions.  This includes files shared with 
gnulib and gettext.

(This does not necessarily mean a particular conditional is still relevant 
to the other projects; they too may remove support for some older systems, 
although supporting a much wider range of systems than glibc.  But you'd 
need to consult with the gettext and gnulib communities to determine 
whether a conditional is still relevant there.)
Paul Eggert March 20, 2014, 8:24 p.m. UTC | #4
As far as Gnulib goes, PRI_MACROS_BROKEN is obsolete and can be 
removed.  It's for AIX 4.3.3 (released 1999), which IBM hasn't supported 
since 2003.  When the original supplier no longer supports a platform, 
the general rule is that Gnulib can drop support for it as well.  I 
assume Gettext is the same.
diff mbox

Patch

diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
index b96a997..ff62a30 100644
--- a/intl/loadmsgcat.c
+++ b/intl/loadmsgcat.c
@@ -94,354 +94,354 @@  char *alloca ();
 /* Provide fallback values for macros that ought to be defined in <inttypes.h>.
    Note that our fallback values need not be literal strings, because we don't
    use them with preprocessor string concatenation.  */
-#if !defined PRId8 || PRI_MACROS_BROKEN
+#if !defined PRId8
 # undef PRId8
 # define PRId8 "d"
 #endif
-#if !defined PRIi8 || PRI_MACROS_BROKEN
+#if !defined PRIi8
 # undef PRIi8
 # define PRIi8 "i"
 #endif
-#if !defined PRIo8 || PRI_MACROS_BROKEN
+#if !defined PRIo8
 # undef PRIo8
 # define PRIo8 "o"
 #endif
-#if !defined PRIu8 || PRI_MACROS_BROKEN
+#if !defined PRIu8
 # undef PRIu8
 # define PRIu8 "u"
 #endif
-#if !defined PRIx8 || PRI_MACROS_BROKEN
+#if !defined PRIx8
 # undef PRIx8
 # define PRIx8 "x"
 #endif
-#if !defined PRIX8 || PRI_MACROS_BROKEN
+#if !defined PRIX8
 # undef PRIX8
 # define PRIX8 "X"
 #endif
-#if !defined PRId16 || PRI_MACROS_BROKEN
+#if !defined PRId16
 # undef PRId16
 # define PRId16 "d"
 #endif
-#if !defined PRIi16 || PRI_MACROS_BROKEN
+#if !defined PRIi16
 # undef PRIi16
 # define PRIi16 "i"
 #endif
-#if !defined PRIo16 || PRI_MACROS_BROKEN
+#if !defined PRIo16
 # undef PRIo16
 # define PRIo16 "o"
 #endif
-#if !defined PRIu16 || PRI_MACROS_BROKEN
+#if !defined PRIu16
 # undef PRIu16
 # define PRIu16 "u"
 #endif
-#if !defined PRIx16 || PRI_MACROS_BROKEN
+#if !defined PRIx16
 # undef PRIx16
 # define PRIx16 "x"
 #endif
-#if !defined PRIX16 || PRI_MACROS_BROKEN
+#if !defined PRIX16
 # undef PRIX16
 # define PRIX16 "X"
 #endif
-#if !defined PRId32 || PRI_MACROS_BROKEN
+#if !defined PRId32
 # undef PRId32
 # define PRId32 "d"
 #endif
-#if !defined PRIi32 || PRI_MACROS_BROKEN
+#if !defined PRIi32
 # undef PRIi32
 # define PRIi32 "i"
 #endif
-#if !defined PRIo32 || PRI_MACROS_BROKEN
+#if !defined PRIo32
 # undef PRIo32
 # define PRIo32 "o"
 #endif
-#if !defined PRIu32 || PRI_MACROS_BROKEN
+#if !defined PRIu32
 # undef PRIu32
 # define PRIu32 "u"
 #endif
-#if !defined PRIx32 || PRI_MACROS_BROKEN
+#if !defined PRIx32
 # undef PRIx32
 # define PRIx32 "x"
 #endif
-#if !defined PRIX32 || PRI_MACROS_BROKEN
+#if !defined PRIX32
 # undef PRIX32
 # define PRIX32 "X"
 #endif
-#if !defined PRId64 || PRI_MACROS_BROKEN
+#if !defined PRId64
 # undef PRId64
 # define PRId64 (sizeof (long) == 8 ? "ld" : "lld")
 #endif
-#if !defined PRIi64 || PRI_MACROS_BROKEN
+#if !defined PRIi64
 # undef PRIi64
 # define PRIi64 (sizeof (long) == 8 ? "li" : "lli")
 #endif
-#if !defined PRIo64 || PRI_MACROS_BROKEN
+#if !defined PRIo64
 # undef PRIo64
 # define PRIo64 (sizeof (long) == 8 ? "lo" : "llo")
 #endif
-#if !defined PRIu64 || PRI_MACROS_BROKEN
+#if !defined PRIu64
 # undef PRIu64
 # define PRIu64 (sizeof (long) == 8 ? "lu" : "llu")
 #endif
-#if !defined PRIx64 || PRI_MACROS_BROKEN
+#if !defined PRIx64
 # undef PRIx64
 # define PRIx64 (sizeof (long) == 8 ? "lx" : "llx")
 #endif
-#if !defined PRIX64 || PRI_MACROS_BROKEN
+#if !defined PRIX64
 # undef PRIX64
 # define PRIX64 (sizeof (long) == 8 ? "lX" : "llX")
 #endif
-#if !defined PRIdLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIdLEAST8
 # undef PRIdLEAST8
 # define PRIdLEAST8 "d"
 #endif
-#if !defined PRIiLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIiLEAST8
 # undef PRIiLEAST8
 # define PRIiLEAST8 "i"
 #endif
-#if !defined PRIoLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIoLEAST8
 # undef PRIoLEAST8
 # define PRIoLEAST8 "o"
 #endif
-#if !defined PRIuLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIuLEAST8
 # undef PRIuLEAST8
 # define PRIuLEAST8 "u"
 #endif
-#if !defined PRIxLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIxLEAST8
 # undef PRIxLEAST8
 # define PRIxLEAST8 "x"
 #endif
-#if !defined PRIXLEAST8 || PRI_MACROS_BROKEN
+#if !defined PRIXLEAST8
 # undef PRIXLEAST8
 # define PRIXLEAST8 "X"
 #endif
-#if !defined PRIdLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIdLEAST16
 # undef PRIdLEAST16
 # define PRIdLEAST16 "d"
 #endif
-#if !defined PRIiLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIiLEAST16
 # undef PRIiLEAST16
 # define PRIiLEAST16 "i"
 #endif
-#if !defined PRIoLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIoLEAST16
 # undef PRIoLEAST16
 # define PRIoLEAST16 "o"
 #endif
-#if !defined PRIuLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIuLEAST16
 # undef PRIuLEAST16
 # define PRIuLEAST16 "u"
 #endif
-#if !defined PRIxLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIxLEAST16
 # undef PRIxLEAST16
 # define PRIxLEAST16 "x"
 #endif
-#if !defined PRIXLEAST16 || PRI_MACROS_BROKEN
+#if !defined PRIXLEAST16
 # undef PRIXLEAST16
 # define PRIXLEAST16 "X"
 #endif
-#if !defined PRIdLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIdLEAST32
 # undef PRIdLEAST32
 # define PRIdLEAST32 "d"
 #endif
-#if !defined PRIiLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIiLEAST32
 # undef PRIiLEAST32
 # define PRIiLEAST32 "i"
 #endif
-#if !defined PRIoLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIoLEAST32
 # undef PRIoLEAST32
 # define PRIoLEAST32 "o"
 #endif
-#if !defined PRIuLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIuLEAST32
 # undef PRIuLEAST32
 # define PRIuLEAST32 "u"
 #endif
-#if !defined PRIxLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIxLEAST32
 # undef PRIxLEAST32
 # define PRIxLEAST32 "x"
 #endif
-#if !defined PRIXLEAST32 || PRI_MACROS_BROKEN
+#if !defined PRIXLEAST32
 # undef PRIXLEAST32
 # define PRIXLEAST32 "X"
 #endif
-#if !defined PRIdLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIdLEAST64
 # undef PRIdLEAST64
 # define PRIdLEAST64 PRId64
 #endif
-#if !defined PRIiLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIiLEAST64
 # undef PRIiLEAST64
 # define PRIiLEAST64 PRIi64
 #endif
-#if !defined PRIoLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIoLEAST64
 # undef PRIoLEAST64
 # define PRIoLEAST64 PRIo64
 #endif
-#if !defined PRIuLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIuLEAST64
 # undef PRIuLEAST64
 # define PRIuLEAST64 PRIu64
 #endif
-#if !defined PRIxLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIxLEAST64
 # undef PRIxLEAST64
 # define PRIxLEAST64 PRIx64
 #endif
-#if !defined PRIXLEAST64 || PRI_MACROS_BROKEN
+#if !defined PRIXLEAST64
 # undef PRIXLEAST64
 # define PRIXLEAST64 PRIX64
 #endif
-#if !defined PRIdFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIdFAST8
 # undef PRIdFAST8
 # define PRIdFAST8 "d"
 #endif
-#if !defined PRIiFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIiFAST8
 # undef PRIiFAST8
 # define PRIiFAST8 "i"
 #endif
-#if !defined PRIoFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIoFAST8
 # undef PRIoFAST8
 # define PRIoFAST8 "o"
 #endif
-#if !defined PRIuFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIuFAST8
 # undef PRIuFAST8
 # define PRIuFAST8 "u"
 #endif
-#if !defined PRIxFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIxFAST8
 # undef PRIxFAST8
 # define PRIxFAST8 "x"
 #endif
-#if !defined PRIXFAST8 || PRI_MACROS_BROKEN
+#if !defined PRIXFAST8
 # undef PRIXFAST8
 # define PRIXFAST8 "X"
 #endif
-#if !defined PRIdFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIdFAST16
 # undef PRIdFAST16
 # define PRIdFAST16 "d"
 #endif
-#if !defined PRIiFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIiFAST16
 # undef PRIiFAST16
 # define PRIiFAST16 "i"
 #endif
-#if !defined PRIoFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIoFAST16
 # undef PRIoFAST16
 # define PRIoFAST16 "o"
 #endif
-#if !defined PRIuFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIuFAST16
 # undef PRIuFAST16
 # define PRIuFAST16 "u"
 #endif
-#if !defined PRIxFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIxFAST16
 # undef PRIxFAST16
 # define PRIxFAST16 "x"
 #endif
-#if !defined PRIXFAST16 || PRI_MACROS_BROKEN
+#if !defined PRIXFAST16
 # undef PRIXFAST16
 # define PRIXFAST16 "X"
 #endif
-#if !defined PRIdFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIdFAST32
 # undef PRIdFAST32
 # define PRIdFAST32 "d"
 #endif
-#if !defined PRIiFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIiFAST32
 # undef PRIiFAST32
 # define PRIiFAST32 "i"
 #endif
-#if !defined PRIoFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIoFAST32
 # undef PRIoFAST32
 # define PRIoFAST32 "o"
 #endif
-#if !defined PRIuFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIuFAST32
 # undef PRIuFAST32
 # define PRIuFAST32 "u"
 #endif
-#if !defined PRIxFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIxFAST32
 # undef PRIxFAST32
 # define PRIxFAST32 "x"
 #endif
-#if !defined PRIXFAST32 || PRI_MACROS_BROKEN
+#if !defined PRIXFAST32
 # undef PRIXFAST32
 # define PRIXFAST32 "X"
 #endif
-#if !defined PRIdFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIdFAST64
 # undef PRIdFAST64
 # define PRIdFAST64 PRId64
 #endif
-#if !defined PRIiFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIiFAST64
 # undef PRIiFAST64
 # define PRIiFAST64 PRIi64
 #endif
-#if !defined PRIoFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIoFAST64
 # undef PRIoFAST64
 # define PRIoFAST64 PRIo64
 #endif
-#if !defined PRIuFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIuFAST64
 # undef PRIuFAST64
 # define PRIuFAST64 PRIu64
 #endif
-#if !defined PRIxFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIxFAST64
 # undef PRIxFAST64
 # define PRIxFAST64 PRIx64
 #endif
-#if !defined PRIXFAST64 || PRI_MACROS_BROKEN
+#if !defined PRIXFAST64
 # undef PRIXFAST64
 # define PRIXFAST64 PRIX64
 #endif
-#if !defined PRIdMAX || PRI_MACROS_BROKEN
+#if !defined PRIdMAX
 # undef PRIdMAX
 # define PRIdMAX (sizeof (uintmax_t) == sizeof (long) ? "ld" : "lld")
 #endif
-#if !defined PRIiMAX || PRI_MACROS_BROKEN
+#if !defined PRIiMAX
 # undef PRIiMAX
 # define PRIiMAX (sizeof (uintmax_t) == sizeof (long) ? "li" : "lli")
 #endif
-#if !defined PRIoMAX || PRI_MACROS_BROKEN
+#if !defined PRIoMAX
 # undef PRIoMAX
 # define PRIoMAX (sizeof (uintmax_t) == sizeof (long) ? "lo" : "llo")
 #endif
-#if !defined PRIuMAX || PRI_MACROS_BROKEN
+#if !defined PRIuMAX
 # undef PRIuMAX
 # define PRIuMAX (sizeof (uintmax_t) == sizeof (long) ? "lu" : "llu")
 #endif
-#if !defined PRIxMAX || PRI_MACROS_BROKEN
+#if !defined PRIxMAX
 # undef PRIxMAX
 # define PRIxMAX (sizeof (uintmax_t) == sizeof (long) ? "lx" : "llx")
 #endif
-#if !defined PRIXMAX || PRI_MACROS_BROKEN
+#if !defined PRIXMAX
 # undef PRIXMAX
 # define PRIXMAX (sizeof (uintmax_t) == sizeof (long) ? "lX" : "llX")
 #endif
-#if !defined PRIdPTR || PRI_MACROS_BROKEN
+#if !defined PRIdPTR
 # undef PRIdPTR
 # define PRIdPTR \
   (sizeof (void *) == sizeof (long) ? "ld" : \
    sizeof (void *) == sizeof (int) ? "d" : \
    "lld")
 #endif
-#if !defined PRIiPTR || PRI_MACROS_BROKEN
+#if !defined PRIiPTR
 # undef PRIiPTR
 # define PRIiPTR \
   (sizeof (void *) == sizeof (long) ? "li" : \
    sizeof (void *) == sizeof (int) ? "i" : \
    "lli")
 #endif
-#if !defined PRIoPTR || PRI_MACROS_BROKEN
+#if !defined PRIoPTR
 # undef PRIoPTR
 # define PRIoPTR \
   (sizeof (void *) == sizeof (long) ? "lo" : \
    sizeof (void *) == sizeof (int) ? "o" : \
    "llo")
 #endif
-#if !defined PRIuPTR || PRI_MACROS_BROKEN
+#if !defined PRIuPTR
 # undef PRIuPTR
 # define PRIuPTR \
   (sizeof (void *) == sizeof (long) ? "lu" : \
    sizeof (void *) == sizeof (int) ? "u" : \
    "llu")
 #endif
-#if !defined PRIxPTR || PRI_MACROS_BROKEN
+#if !defined PRIxPTR
 # undef PRIxPTR
 # define PRIxPTR \
   (sizeof (void *) == sizeof (long) ? "lx" : \
    sizeof (void *) == sizeof (int) ? "x" : \
    "llx")
 #endif
-#if !defined PRIXPTR || PRI_MACROS_BROKEN
+#if !defined PRIXPTR
 # undef PRIXPTR
 # define PRIXPTR \
   (sizeof (void *) == sizeof (long) ? "lX" : \