[FFmpeg-devel] [PATCH] Remove printf format string errors in windows builds
Larry Robinson
silver-dad
Mon Jan 24 02:21:29 CET 2011
On 1/23/2011 4:40 PM, M?ns Rullg?rd wrote:
> Alex Converse<alex.converse at gmail.com> writes:
>
>> 2011/1/23 M?ns Rullg?rd<mans at mansr.com>:
>>> Alex Converse<alex.converse at gmail.com> writes:
>>>
>>>> 2011/1/23 M?ns Rullg?rd<mans at mansr.com>:
>>>>> Diego Elio Petten?<flameeyes at gmail.com> writes:
>>>>>
>>>>>> Il giorno dom, 23/01/2011 alle 14.58 -0800, Larry Robinson ha scritto:
>>>>>>> This patch uses #ifndef _WIN32 to replace these specifiers with `%Id'
>>>>>>> (the windows equivalent) for windows builds.
>>>>>> Aren't there PRI or SCN macros to use to replace those rather than
>>>>>> doubling the lines with #if _WIN32?
>>>>> The problem is that windows doesn't implement the C standard.
>>>>>
>>>> Doesn't MinGW provide it's own stdint/inttypes headers? If it doesn't
>>>> I know there are compatibility headers. PRI/SCN constants should be
>>>> available somehow.
>>> There are no standard macros for those modifiers for the simple reason
>>> that the modifiers themselves are already standard. The PRI macros
>>> are only for the sized intXX_t types. These could perhaps also have
>>> been assigned specific format letters, but maybe the alphabet ran out.
>> Then let's make FFPRISIZE and FFPRIPTRDIFF macros?
> First let's ask the mingw devs about supporting the standard. I don't
> want to make the code uglier than necessary.
>
> Aside from the warnings, does anything actually break? I thought
> people had been using FFmpeg on windows for years.
>
Just to be clear, I am building on Mingw-w64, which is separate from
mingw32 and produces 64-bit executables. It is not a problem on mingw32
because you can use -D__USE_MINGW_ANSI_STDIO=1 to force conformance
(thanks to Jean-Baptiste Kempf for pointing this out), but this is not
yet implemented for sscanf in Mingw-w64.
What breaks is a number of error messages which will print incorrectly,
but for a successful run these sections of code are not executed.
Regards,
Larry Robinson
More information about the ffmpeg-devel
mailing list