Greg Ercolano wrote:
>..and complete build output just to show how it worked (and what
>warning messages were left) over here:
>
> BUILD LOG:
>
> http://seriss.com/people/erco/fltk/tmp/okbuild-6971-win32-vsexpress-2008.txt
Just a reminder; the warnings from the WIN32 buil
> [..]it seems [the Microsoft] _snprintf() doesn't follow the C99 spec,
> so the function apparently works incorrectly [or at least unexpectedly
> if you're used to the C99 spec version) on the very
> boundary conditions it's supposed to protect us from. eg:
The following is a p
On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
> Solution on win32 is to change _snprintf() to _snprintf_s()
> with the _TRUNCATE macro as the third argument. But there's no
> clear way to use a macro shortcut to do this (since this is a
> varargs function), so a cross pl
imacarthur wrote:
> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>> Solution on win32 is to change _snprintf() to _snprintf_s()
>> with the _TRUNCATE macro as the third argument. But there's no
>> clear way to use a macro shortcut to do this (since this is a
>> varargs functio
imacarthur wrote:
> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>> Solution on win32 is to change _snprintf() to _snprintf_s()
>> with the _TRUNCATE macro as the third argument. But there's no
>> clear way to use a macro shortcut to do this (since this is a
>> varargs functio
On 30 Dec 2009, at 23:14, Greg Ercolano wrote:
>
> BEFORE: #define SNPRINTF(SS, CC, ...) snprintf(SS, CC, _TRUNCATE,
> __VA_ARGS__)
> AFTER: #define SNPRINTF(SS, CC, ...) _snprintf_s(SS, CC,
> _TRUNCATE, __VA_ARGS__)
> ^^^
>
> Gotta have tha
On 30 Dec 2009, at 23:14, Greg Ercolano wrote:
>
> ..and the output on win32 was just like linux, making the above code
> cross platform compilable:
>
> Z:\erco\examples\c>.\test-snprintf_s
> RET=6, SS='123456': TEST RESULT: OK
> RET=7, SS='1234567': TEST RESULT: OK
> RET=-1, SS='12345
It occurred to me that rather than using the variadic macros
solution, we can always (on the win32 platforms) just define our own
"snprintf()" wrapper function for _snprintf_s(...), say in
Fl_win32.cxx or elsewhere.
Then so long as libfltk is linked in before the system libs,
"everyone" w
On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>> [..]it seems [the Microsoft] _snprintf() doesn't follow the
>> C99 spec,
>> so the function apparently works incorrectly [or at least
>> unexpectedly
>> if you're used to the C99 spec version) on the very
>> boundary conditions
imacarthur wrote:
> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>> Solution on win32 is to change _snprintf() to _snprintf_s()
>> with the _TRUNCATE macro as the third argument. But there's no
>> clear way to use a macro shortcut to do this (since this is a
>> varargs functio
imacarthur wrote:
> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>> Solution on win32 is to change _snprintf() to _snprintf_s()
>> with the _TRUNCATE macro as the third argument. But there's no
>> clear way to use a macro shortcut to do this (since this is a
>> varargs functio
imacarthur wrote:
> Just tested this on Vista with mingw, and it fails exactly as Greg's VS
> example fails (because mingw mainly just wraps the native system libs in
> general.)
That's strange. I can't confirm this with WinXP and the cygwin/mingw
compiler (neither in cygwin nor in mingw (-mno-
On 1 Jan 2010, at 18:16, Greg Ercolano wrote:
> imacarthur wrote:
>> On 30 Dec 2009, at 19:24, Greg Ercolano wrote:
>>> Solution on win32 is to change _snprintf() to _snprintf_s()
>>> with the _TRUNCATE macro as the third argument. But there's no
>>> clear way to use a macro shortcut
On 1 Jan 2010, at 20:32, Albrecht Schlosser wrote:
> imacarthur wrote:
>
>> Just tested this on Vista with mingw, and it fails exactly as
>> Greg's VS
>> example fails (because mingw mainly just wraps the native system
>> libs in
>> general.)
>
> That's strange. I can't confirm this with WinX
imacarthur wrote:
> I acknowledge that we have differing views on this, but I do not believe
> that "cygwin -mno-cygwin" is actually the same thing as mingw.
>
> In particular, I think that the -mno-cygwin option mainly turns off the
> use of the "posix emulation" features of cygwin, but I do n
>> Then I tried this:
>>
>> #ifdef _WIN32
>> extern "C" int fl_snprintf(char *, size_t, const char *, ...);
>> #define snprintf fl_snprintf
>> #endif /*MICROSOFT*/
Hmm, OK, so I guess I'll change my test program to use fl_snprintf.
And if that works normally, is it the case the
Greg Ercolano wrote:
> Hmm, OK, so I guess I'll change my test program to use fl_snprintf.
>
> And if that works normally, is it the case the fix would be
> to modify all fltk calls to snprintf() to call fl_snprintf()
> instead?
>
> Will follow up.
In VS 2008, u
> [..] because fl_snprintf() appears to be a complete
> standalone implementation of snprintf(), so its behavior should be
> consistent on all platforms.
Actually it's fl_vsnprintf() (emphasis on 'v') that's defined in full.
fl_snprintf() is a wrapper function that invokes vsn
18 matches
Mail list logo