From: Keith M. <kei...@us...> - 2008-12-16 06:33:46
|
On Monday 15 December 2008 04:25:03 Sisyphus wrote: > One thing that I'm struggling to achieve is to have an > ansi-compliant printf() in a static library. FTR, the ansi-compliant printf() is provided by a MinGW specific function, __mingw_printf(), (and similarly for __mingw_fprintf(), etc.). These all live in libmingwex.a, which is *always* linked statically. > For testing, I created a 'libfoo.a' as follows: > > [...snip...] > > C:\_32\C>gcc -D__USE_MINGW_ANSI_STDIO -o foo.exe foo.c -L. -lfoo FWIW, __USE_MINGW_ANSI_STDIO is an internal symbol, (as is hinted by the double underscore prefix). It is defined internally, as a side effect of specifying either `-posix' or `-ansi', (or as a side effect of defining any one of a number of other publicly documented symbols, as specified in _mingw.h). In general, you should prefer to specify `-ansi' or `-posix', rather than defining __USE_MINGW_ANSI_STDIO directly, as you do here. > C:\_32\C>foo > 0.032258 > -0.000000 Using *exactly* your sample code, copied and pasted from your message, I am unable to reproduce this... > Is there any way to have my_print() print out 0.032258 ? For me, this is exactly what I see. -- Regards, Keith. |