I discovered the problem, it is the fact that the macros are not defined if 
C++ is being used. this locks out C++.

#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)

i think it has to do with the C99 standard.



>________________________________
> From: Óscar Fuentes <[email protected]>
>To: [email protected] 
>Sent: Saturday, June 21, 2014 5:35 PM
>Subject: Re: [Mingw-w64-public] problem with compiler not concatenating        
>strings
> 
>
>Jim Michaels <[email protected]> writes:
>
>>      printf("abc%" "I64u" "def", 12);
>>                                    ^
>> inttypes-strings.cpp:5:19: error: expected ')' before 'PRSIu64'
>>      printf("abc%" PRSIu64 "def", 12);
>>                    ^
>> inttypes-strings.cpp:5:36: warning: spurious trailing '%' in format 
>> [-Wformat=]
>>      printf("abc%" PRSIu64 "def", 12);
>>
>>
>> #include <inttypes.h>
>> #include <stdio.h>
>> int main(void) {
>>     printf("abc%" "I64u" "def", 12);
>>     printf("abc%" PRSIu64 "def", 12);
>>     return 0;
>> }
>>
>> has the c++ standard been changed? it used to be that  C/C++ would
>> join separate strings that are separated by whitespace. this was a
>> very useful feature and I need it.
>> thanks.
>
>PRSIu64 is not a string. It is not surrounded by quotation marks. The
>fact that the compiler accepts the first printf but rejects the second
>makes obvious that there is no problem with string concatenation.
>
>Apart from that, is %P a valid conversion format? I suspect that it is
>another typo on your test case.
>
>
>------------------------------------------------------------------------------
>HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
>Find What Matters Most in Your Big Data with HPCC Systems
>Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>Leverages Graph Analysis for Fast Processing & Easy Data Exploration
>http://p.sf.net/sfu/hpccsystems
>_______________________________________________
>Mingw-w64-public mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to