[compiler-rt] r198650 - Explicitly enable PRIu64 by defining __STDC_FORMAT_MACROS if it isn't

Kaelyn Takata rikka at google.com
Wed Jan 8 11:14:04 PST 2014


No idea. I was mainly trying to fix the format mismatch for fprintf + an
uint64_t that ended up mired in cross-platform compatibility issues. I
wasn't about to go mucking around in yet more areas I know nothing about
(the build systems) just to fix a warning from a single fprintf statement
in some new code that was causing some builds to break. I welcome someone
who knows more about the build system or the involved compiler-rt code to
provide a cleaner solution to the original problem and/or the subsequent
changes I committed to make my original simple fix work on darwin.


On Mon, Jan 6, 2014 at 4:40 PM, Eric Christopher <echristo at gmail.com> wrote:

> Hrm. Everything else in llvm already assumes that these are defined.
> Should the compiler-rt makefiles do the same?
>
> -eric
>
> On Mon, Jan 6, 2014 at 4:29 PM, Kaelyn Uhrain <rikka at google.com> wrote:
> > Author: rikka
> > Date: Mon Jan  6 18:29:19 2014
> > New Revision: 198650
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=198650&view=rev
> > Log:
> > Explicitly enable PRIu64 by defining __STDC_FORMAT_MACROS if it isn't
> > yet defined.
> >
> > Modified:
> >     compiler-rt/trunk/lib/profile/PGOProfiling.c
> >
> > Modified: compiler-rt/trunk/lib/profile/PGOProfiling.c
> > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/PGOProfiling.c?rev=198650&r1=198649&r2=198650&view=diff
> >
> ==============================================================================
> > --- compiler-rt/trunk/lib/profile/PGOProfiling.c (original)
> > +++ compiler-rt/trunk/lib/profile/PGOProfiling.c Mon Jan  6 18:29:19 2014
> > @@ -10,6 +10,12 @@
> >  #include <stdio.h>
> >  #include <stdlib.h>
> >
> > +// Explicitly request that the format macros like PRIu64 be enabled if
> they
> > +// haven't already been enabled.
> > +#ifndef __STDC_FORMAT_MACROS
> > +#define __STDC_FORMAT_MACROS 1
> > +#endif
> > +
> >  #if !defined(__APPLE__)
> >  #include <inttypes.h>
> >  #endif
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140108/5bb3b785/attachment.html>


More information about the llvm-commits mailing list