http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47945
Janne Blomqvist <jb at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jb at gcc dot gnu.org --- Comment #15 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-03-03 14:03:40 UTC --- (In reply to comment #13) > (In reply to comment #12) > > could it be that it was the intention to set __USE_MINGW_ANSI_STDIO in > > effect? > > Yes - and that is what does happen for _POSIX=1 on MinGW64. But it does not > happen for _POSIX=1 on the 32bit MinGW. > > Jerry et al.: Do you think the following patch is OK? > > --- a/libgfortran/libgfortran.h > +++ b/libgfortran/libgfortran.h > @@ -33,6 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If > not, see > any system header file is included. */ > #if defined __MINGW32__ > # define _POSIX 1 > +# define _POSIX_SOURCE 1 > # define gfc_printf gnu_printf > #else > # define gfc_printf __printf__ Well, first a disclaimer: I don't use Windows myself, and I have little experience with win32 programming, and finally, I have no way of testing mingw specific functionality. That being said, I'm not sure this patch accomplishes anything. Looking at the _mingw.h you linked to in another post, __USE_MINGW_ANSI_STDIO is set also if _GNU_SOURCE is set. Which AFAICS is always set when compiling libgfortran (there's even a bit of belt-and-suspenders approach here, in that _GNU_SOURCE is set from both AC_USE_SYSTEM_EXTENSIONS as well as explicitly added to AM_CFLAGS in Makefile.am; probably the second one can be removed as a janitorial patch once 4.7 opens). Secondly, IIRC mingw64 also sets __MINGW32__, so there should be no difference between mingw32 and ming64 here. Third, I'm somewhat wary of playing with preprocessor defines this close to a release. As this issue doesn't seem particularly critical, I'd vote for postponing it until 4.7. That is, unless Kai or someone else who actually understands mingw pops in and says it's completely safe and will fix the issue.