This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Fix PRI_MACROS_BROKEN undef warnings.


I sent one patch to fix it sometime ago, https://sourceware.org/ml/libc-alpha/2014-03/msg00658.html;
but got no reply.  I don't which option would be preferable.


On 28-04-2014 18:27, Steve Ellcey wrote:
> Here is another undefined macro warning fix.  PRI_MACROS_BROKEN is only
> used in loadmsgcat.c in the intl directory.  It is never set anywhere in
> glibc sources but binutils and gcc use a intl directory that I believe is
> derived from the glibc one.  The configure scripts of these products set
> PRI_MACROS_BROKEN, but the intl sources in them don't appear to have been
> updated from glibc since 2003.
>
> So, if we care about keeping something that is usable with GCC/binutils
> this patch seems like the best fix but if we don't care about staying in
> sync with the intl directory of GCC or binutils we could just remove
> PRI_MACROS_BROKEN completely or even remove the entire section of code
> that sets the various PRI* macros since we know that glibc itself has the
> correct definitions.
>
> The m4 macro that binutils and GCC use to set PRI_MACROS_BROKEN mentions
> AIX 4.3.3 as a platform where the macros are defined as non-string values.
> There are already a number differences between intl in glibc and the one
> in GCC and binutils.
>
> Tested on mips-mti-linux-gnu with no difference in the object files
> generated.
>
> Steve Ellcey
> sellcey@mips.com
>
>
> 2014-04-28  Steve Ellcey  <sellcey@mips.com>
>
> 	* intl/intl/loadmsgcat.c (PRI_MACROS_BROKEN): Set default value if
> 	not set.
>
> diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
> index b96a997..e6483ce 100644
> --- a/intl/loadmsgcat.c
> +++ b/intl/loadmsgcat.c
> @@ -94,6 +94,11 @@ 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.  */
> +
> +#ifndef PRI_MACROS_BROKEN
> +#define PRI_MACROS_BROKEN 0
> +#endif
> +
>  #if !defined PRId8 || PRI_MACROS_BROKEN
>  # undef PRId8
>  # define PRId8 "d"
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]