On Wed, Oct 10, 2012 at 9:34 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
libc++ does this to pick up the macro definitions:<div><br></div><div><div>#include <inttypes.h></div><div><br></div><div>However, glibc's inttypes.h only provides them in C++ mode if _STDC_FORMAT_MACROS is defined, and libc++ doesn't define it.</div>
</div></blockquote><div><br></div><div>Sorry, needs more underscore: __STDC_FORMAT_MACROS.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div class="h5">
<div class="gmail_quote">On Wed, Oct 10, 2012 at 12:53 PM, Daniel Hofmann <span dir="ltr"><<a href="mailto:daniel@trvx.org" target="_blank">daniel@trvx.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<br>
I'm currently porting a program from g++/libstdc++ to clang/libcxx and<br>
was quite surprised that the platform independent printing using format<br>
constants, e.g. PRId64, produces errors with libcxx.<br>
<br>
A simple example which compiles fine w/o libcxx or g++<br>
> #include <cstdio><br>
> #include <cinttypes><br>
><br>
> int main() {<br>
>   int64_t n = 1;<br>
><br>
>   printf("%" PRId64, n);<br>
> }<br>
<br>
w/ -stdlib=libcxx<br>
> +7:14: error: expected ')'<br>
>   printf("%" PRId64, n);<br>
>              ^<br>
> +7:9: note: to match this '('<br>
>   printf("%" PRId64, n);<br>
>         ^<br>
<br>
Although the cinttypes header comments lists them<br>
> Macros:<br>
>     ...<br>
>     PRId64<br>
<br>
<br>
So, what am I missing here? Is this not yet supported? How am I supposed<br>
to handle this?<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br>