[Mingw-users] Deprecation of __USE_MINGW_ANSI_STDIO

Back to archive index
Eli Zaretskii eliz****@gnu*****
Sat Jan 5 21:13:17 JST 2019


I've installed the latest MinGW runtime 5.2 today, and hit this snag:

  In file included from d:/gnu/git/emacs/branch/nt/inc/mingw_time.h:13:0,
		   from d:/gnu/git/emacs/branch/nt/inc/ms-w32.h:27,
		   from ../src/conf_post.h:35,
		   from ../src/config.h:2019,
		   from acl_entries.c:20:
  d:\usr\include\_mingw.h:383:3: warning: #warning "Direct definition of __USE_MINGW_ANSI_STDIO is deprecated." [-Wcpp]
   # warning "Direct definition of __USE_MINGW_ANSI_STDIO is deprecated."
     ^~~~~~~
  d:\usr\include\_mingw.h:384:10: note: #pragma message: See <_mingw.h> for preferred feature activation methods.
   # pragma message "See <_mingw.h> for preferred feature activation methods."
	    ^~~~~~~

This deprecation warning is going to be a terrible nuisance, for the
following reasons:

  . Many packages nowadays use -D__USE_MINGW_ANSI_STDIO or equivalent
    #define in their headers, and there's no good way of retrofitting
    them all to adapt to this change.  Moreover, the Gnulib's stdio.m4
    macros emit a #define __USE_MINGW_ANSI_STDIO line into the
    package's config.h, when the package is being configured for
    MinGW, so any package that uses Gnulib will be hit by this.

  . Using -Wno-cpp to shut up this warning will also shut up all the
    warnings emitted by #warning, so is a too blunt instrument.

  . The place where the warning is emitted, _mingw.h, makes a bad
    situation even worse, because that header is needed to identify
    mingw.org's MinGW and distinguish between it and MinGW64 (which
    doesn't have __MINGW_FEATURES__ and uses __USE_MINGW_ANSI_STDIO).
    Even if a package does want to switch to using __MINGW_FEATURES__,
    I don't see how to do that in a way that will not adversely affect
    a MinGW64 build of the same package.

Did I miss some reasonable way of shutting up this warning and
switching to __MINGW_FEATURES__?  If not, then I respectfully request
that this warning be removed, as IMO it does more harm than help.
Unless I'm missing something important, the direct use of
__USE_MINGW_ANSI_STDIO is really a benign issue, and the deprecation
warning is only justified if __USE_MINGW_ANSI_STDIO is planned to be
removed in the foreseeable future.  And I cannot imagine why we'd want
to remove __USE_MINGW_ANSI_STDIO at this stage.  Is its removal really
planned?

At the very least, if there must be such a warning, please move it to
stdio.h, so that a package could include _mingw.h early on without
triggering the warning, and then #undef __USE_MINGW_ANSI_STDIO as
needed.

Thanks.



More information about the MinGW-Users mailing list
Back to archive index