You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which I believe need a new "case" in the "ParsePrintfSpecifier" function, which would look somewhat like this:
case 'I':
if(triplet.third == "win32" || triplet.third == "mingw32")
k = ConversionSpecifier::???;
break;
And perhaps similar modifications for the glibc (which would check for glibc being used) and objc (which should check for objc being used) conversion specifier. I do not know what ??? should be, nor if this well then be properly handled, so I'm leaving this to the experts.
I'll gladly test a patch for this, but I'm too stupid and C-agnostic to even understand what the function in question is doing.
The interesting bits (for when we actually do this):
Types:
%c/%s means wint_t/wchar_t* for wprintf
%C/%S means wint_t/wchar_t* for printf and int/char* for wprintf
%Z means UNICODE_STRING * (custom struct type)
Extended Description
Running this code through MinGW-w64 based Clang:
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include
int main(int argc,char **argv)
{
uint64_t val=1234567890;
printf("%" PRId64"\n",val);
exit(0);
}
gives following warning:
M:\Development\x64\test>clang++ -std=c++11 test.cpp -c -Wall
test.cpp:11:15: warning: invalid conversion specifier 'I'
[-Wformat-invalid-specifier]
printf("%" PRId64"\n",val);
~~~^
M:/Development/mingw64/bin/../lib/clang/3.1/../../../x86_64-w64-mingw32/include\inttypes.h:42:17: note:
expanded from macro 'PRId64'
#define PRId64 "I64d"
^
1 warning generated.
The PRId64 is defined to a valid msvcrt (Windows C runtime) format specifier, all of which are documented here: http://msdn.microsoft.com/en-us/library/56e442dc.aspx
I dug through the code, and ended up in these files:
http://llvm.org/svn/llvm-project/cfe/trunk/lib/Analysis/PrintfFormatString.cpp
http://llvm.org/svn/llvm-project/cfe/trunk/lib/Analysis/ScanfFormatString.cpp
Which I believe need a new "case" in the "ParsePrintfSpecifier" function, which would look somewhat like this:
And perhaps similar modifications for the glibc (which would check for glibc being used) and objc (which should check for objc being used) conversion specifier. I do not know what ??? should be, nor if this well then be properly handled, so I'm leaving this to the experts.
I'll gladly test a patch for this, but I'm too stupid and C-agnostic to even understand what the function in question is doing.
Related mailing list discussion:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-August/023600.html
PS: for testing on Windows, download the GCC dw2 4.6.3-1 (http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/release/i686-w64-mingw32-gcc-dw2-4.6.3-1-release-win32_rubenvb.7z/download) and assorted Clang 3.1 (http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/release/i686-w64-mingw32-clang-3.1-release-win32_rubenvb.7z/download) and extract to the same directory. But as I said, I can take care of the testing myself.
The text was updated successfully, but these errors were encountered: