qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
@ 2019-04-24  9:45 Gwendolyn Haller
  2019-04-24  9:45 ` Gwendolyn Haller
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Gwendolyn Haller @ 2019-04-24  9:45 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Compilation against GIT master fails at the following step:

  CC      qga/commands.o
In file included from qga/commands.c:13:
C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
 #define __USE_MINGW_ANSI_STDIO 1

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                 from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                 from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                 from qga/commands.c:13:
C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
 #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

cc1.exe: all warnings being treated as errors
make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure resolves
the error. Digging deeper in x86_64-w64-mingw32/include/_mingw.h, it
looks like __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
compilation. With C only code it's ignored and doesn't define
__USE_MINGW_ANSI_STDIO as expected:

/* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
   Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
#if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
     || defined (_ISOC99_SOURCE) \
     || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
     || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
     || defined (_SVID_SOURCE)) \
    && !defined(__USE_MINGW_ANSI_STDIO)
/* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
 * and If user did _not_ specify it explicitly... */
#  define __USE_MINGW_ANSI_STDIO			1
#endif

** Affects: qemu
     Importance: Undecided
         Status: New

** Description changed:

- Compilation against latest GIT version fails at the following step:
+ Compilation against GIT master fails at the following step:
  
-   CC      qga/commands.o
+   CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
-  #define __USE_MINGW_ANSI_STDIO 1
+  #define __USE_MINGW_ANSI_STDIO 1
  
  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
-                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
-                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
-                  from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
-                  from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
-                  from qga/commands.c:13:
+                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
+                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
+                  from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
+                  from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
+                  from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
-  #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */
+  #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */
  
  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1
  
  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure resolves
  the error. Digging deeper in x86_64-w64-mingw32/include/_mingw.h, it
  looks like __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:
  
  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
-    Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
+    Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
-      || defined (_ISOC99_SOURCE) \
-      || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
-      || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
-      || defined (_SVID_SOURCE)) \
-     && !defined(__USE_MINGW_ANSI_STDIO)
+      || defined (_ISOC99_SOURCE) \
+      || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
+      || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
+      || defined (_SVID_SOURCE)) \
+     && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
-  * and If user did _not_ specify it explicitly... */
+  * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  New

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
  2019-04-24  9:45 [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined Gwendolyn Haller
@ 2019-04-24  9:45 ` Gwendolyn Haller
  2019-04-24  9:58 ` [Qemu-devel] [Bug 1826172] " Gwendolyn Haller
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Gwendolyn Haller @ 2019-04-24  9:45 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Compilation against GIT master fails at the following step:

  CC      qga/commands.o
In file included from qga/commands.c:13:
C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
 #define __USE_MINGW_ANSI_STDIO 1

In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                 from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                 from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                 from qga/commands.c:13:
C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
 #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

cc1.exe: all warnings being treated as errors
make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure resolves
the error. Digging deeper in x86_64-w64-mingw32/include/_mingw.h, it
looks like __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
compilation. With C only code it's ignored and doesn't define
__USE_MINGW_ANSI_STDIO as expected:

/* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
   Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
#if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
     || defined (_ISOC99_SOURCE) \
     || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
     || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
     || defined (_SVID_SOURCE)) \
    && !defined(__USE_MINGW_ANSI_STDIO)
/* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
 * and If user did _not_ specify it explicitly... */
#  define __USE_MINGW_ANSI_STDIO			1
#endif

** Affects: qemu
     Importance: Undecided
         Status: New

** Description changed:

- Compilation against latest GIT version fails at the following step:
+ Compilation against GIT master fails at the following step:
  
-   CC      qga/commands.o
+   CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
-  #define __USE_MINGW_ANSI_STDIO 1
+  #define __USE_MINGW_ANSI_STDIO 1
  
  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
-                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
-                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
-                  from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
-                  from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
-                  from qga/commands.c:13:
+                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
+                  from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
+                  from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
+                  from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
+                  from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
-  #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */
+  #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */
  
  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1
  
  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure resolves
  the error. Digging deeper in x86_64-w64-mingw32/include/_mingw.h, it
  looks like __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:
  
  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
-    Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
+    Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
-      || defined (_ISOC99_SOURCE) \
-      || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
-      || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
-      || defined (_SVID_SOURCE)) \
-     && !defined(__USE_MINGW_ANSI_STDIO)
+      || defined (_ISOC99_SOURCE) \
+      || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
+      || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
+      || defined (_SVID_SOURCE)) \
+     && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
-  * and If user did _not_ specify it explicitly... */
+  * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  New

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1826172] Re: Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
  2019-04-24  9:45 [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined Gwendolyn Haller
  2019-04-24  9:45 ` Gwendolyn Haller
@ 2019-04-24  9:58 ` Gwendolyn Haller
  2019-04-24  9:58   ` Gwendolyn Haller
  2019-05-09 16:31 ` Peter Maydell
  2019-08-16  5:16 ` Thomas Huth
  3 siblings, 1 reply; 6+ messages in thread
From: Gwendolyn Haller @ 2019-04-24  9:58 UTC (permalink / raw)
  To: qemu-devel

MinGW-w64 toolchain version:

$ pacman -Ss mingw-w64-x86_64-toolchain
mingw64/mingw-w64-x86_64-binutils 2.30-5 (mingw-w64-x86_64-toolchain) [installed]
    A set of programs to assemble and manipulate binary and object files (mingw-w64)
mingw64/mingw-w64-x86_64-crt-git 7.0.0.5397.291c4f8d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 CRT for Windows
mingw64/mingw-w64-x86_64-gcc 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-ada 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (Ada) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-fortran 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (Fortran) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-libgfortran 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (libgfortran) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-libs 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (libraries) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-objc 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (ObjC,Obj-C++) for MinGW-w64
mingw64/mingw-w64-x86_64-gdb 8.2.1-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Debugger (mingw-w64)
mingw64/mingw-w64-x86_64-headers-git 7.0.0.5397.291c4f8d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 headers for Windows
mingw64/mingw-w64-x86_64-libmangle-git 7.0.0.5230.69c8fad6-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 libmangle
mingw64/mingw-w64-x86_64-libwinpthread-git 7.0.0.5325.11a5459d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winpthreads library
mingw64/mingw-w64-x86_64-make 4.2.1-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU make utility to maintain groups of programs (mingw-w64)
mingw64/mingw-w64-x86_64-pkg-config 0.29.2-1 (mingw-w64-x86_64-toolchain) [installed]
    A system for managing library compile/link flags (mingw-w64)
mingw64/mingw-w64-x86_64-tools-git 7.0.0.5394.0dfb3d3f-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 tools
mingw64/mingw-w64-x86_64-winpthreads-git 7.0.0.5325.11a5459d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winpthreads library
mingw64/mingw-w64-x86_64-winstorecompat-git 7.0.0.5394.0dfb3d3f-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winRT compat library

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  New

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1826172] Re: Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
  2019-04-24  9:58 ` [Qemu-devel] [Bug 1826172] " Gwendolyn Haller
@ 2019-04-24  9:58   ` Gwendolyn Haller
  0 siblings, 0 replies; 6+ messages in thread
From: Gwendolyn Haller @ 2019-04-24  9:58 UTC (permalink / raw)
  To: qemu-devel

MinGW-w64 toolchain version:

$ pacman -Ss mingw-w64-x86_64-toolchain
mingw64/mingw-w64-x86_64-binutils 2.30-5 (mingw-w64-x86_64-toolchain) [installed]
    A set of programs to assemble and manipulate binary and object files (mingw-w64)
mingw64/mingw-w64-x86_64-crt-git 7.0.0.5397.291c4f8d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 CRT for Windows
mingw64/mingw-w64-x86_64-gcc 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (C,C++,OpenMP) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-ada 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (Ada) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-fortran 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (Fortran) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-libgfortran 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (libgfortran) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-libs 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (libraries) for MinGW-w64
mingw64/mingw-w64-x86_64-gcc-objc 8.3.0-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Compiler Collection (ObjC,Obj-C++) for MinGW-w64
mingw64/mingw-w64-x86_64-gdb 8.2.1-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU Debugger (mingw-w64)
mingw64/mingw-w64-x86_64-headers-git 7.0.0.5397.291c4f8d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 headers for Windows
mingw64/mingw-w64-x86_64-libmangle-git 7.0.0.5230.69c8fad6-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 libmangle
mingw64/mingw-w64-x86_64-libwinpthread-git 7.0.0.5325.11a5459d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winpthreads library
mingw64/mingw-w64-x86_64-make 4.2.1-2 (mingw-w64-x86_64-toolchain) [installed]
    GNU make utility to maintain groups of programs (mingw-w64)
mingw64/mingw-w64-x86_64-pkg-config 0.29.2-1 (mingw-w64-x86_64-toolchain) [installed]
    A system for managing library compile/link flags (mingw-w64)
mingw64/mingw-w64-x86_64-tools-git 7.0.0.5394.0dfb3d3f-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 tools
mingw64/mingw-w64-x86_64-winpthreads-git 7.0.0.5325.11a5459d-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winpthreads library
mingw64/mingw-w64-x86_64-winstorecompat-git 7.0.0.5394.0dfb3d3f-1 (mingw-w64-x86_64-toolchain) [installed]
    MinGW-w64 winRT compat library

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  New

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1826172] Re: Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
  2019-04-24  9:45 [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined Gwendolyn Haller
  2019-04-24  9:45 ` Gwendolyn Haller
  2019-04-24  9:58 ` [Qemu-devel] [Bug 1826172] " Gwendolyn Haller
@ 2019-05-09 16:31 ` Peter Maydell
  2019-08-16  5:16 ` Thomas Huth
  3 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2019-05-09 16:31 UTC (permalink / raw)
  To: qemu-devel

Hi; thanks for this bug report. It should be fixed by commit
946376c21be1cd9dcc3c7 in git master, which will be in the 4.1 release.


** Changed in: qemu
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  Fix Committed

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Qemu-devel] [Bug 1826172] Re: Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined
  2019-04-24  9:45 [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined Gwendolyn Haller
                   ` (2 preceding siblings ...)
  2019-05-09 16:31 ` Peter Maydell
@ 2019-08-16  5:16 ` Thomas Huth
  3 siblings, 0 replies; 6+ messages in thread
From: Thomas Huth @ 2019-08-16  5:16 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1826172

Title:
  Compilation on MSYS2/MinGW-w64 fails with error:
  "__USE_MINGW_ANSI_STDIO" redefined

Status in QEMU:
  Fix Released

Bug description:
  Compilation against GIT master fails at the following step:

    CC      qga/commands.o
  In file included from qga/commands.c:13:
  C:/Tempy-chan/qemu/include/qemu/osdep.h:97: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   #define __USE_MINGW_ANSI_STDIO 1

  In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/vadefs.h:9,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw_stdarg.h:14,
                   from C:/msys64/mingw64/x86_64-w64-mingw32/include/stdarg.h:140,
                   from C:/msys64/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include/stdarg.h:1,
                   from C:/Tempy-chan/qemu/include/qemu/osdep.h:88,
                   from qga/commands.c:13:
  C:/msys64/mingw64/x86_64-w64-mingw32/include/_mingw.h:431: note: this is the location of the previous definition
   #define __USE_MINGW_ANSI_STDIO 0      /* was not defined so it should be 0 */

  cc1.exe: all warnings being treated as errors
  make: *** [/c/Tempy-chan/qemu/rules.mak:69: qga/commands.o] Error 1

  Passing --extra-cflags="-D__USE_MINGW_ANSI_STDIO" to configure
  resolves the error. Digging deeper in
  x86_64-w64-mingw32/include/_mingw.h, it looks like
  __USE_MINGW_ANSI_STDIO is only defined for _GNU_SOURCE in C++
  compilation. With C only code it's ignored and doesn't define
  __USE_MINGW_ANSI_STDIO as expected:

  /* We are activating __USE_MINGW_ANSI_STDIO for various define indicators.
     Note that we enable it also for _GNU_SOURCE in C++, but not for C case. */
  #if (defined (_POSIX) || defined (_POSIX_SOURCE) || defined (_POSIX_C_SOURCE) \
       || defined (_ISOC99_SOURCE) \
       || defined (_XOPEN_SOURCE) || defined (_XOPEN_SOURCE_EXTENDED) \
       || (defined (_GNU_SOURCE) && defined (__cplusplus)) \
       || defined (_SVID_SOURCE)) \
      && !defined(__USE_MINGW_ANSI_STDIO)
  /* Enable __USE_MINGW_ANSI_STDIO if _POSIX defined
   * and If user did _not_ specify it explicitly... */
  #  define __USE_MINGW_ANSI_STDIO			1
  #endif

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1826172/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-08-16  5:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24  9:45 [Qemu-devel] [Bug 1826172] [NEW] Compilation on MSYS2/MinGW-w64 fails with error: "__USE_MINGW_ANSI_STDIO" redefined Gwendolyn Haller
2019-04-24  9:45 ` Gwendolyn Haller
2019-04-24  9:58 ` [Qemu-devel] [Bug 1826172] " Gwendolyn Haller
2019-04-24  9:58   ` Gwendolyn Haller
2019-05-09 16:31 ` Peter Maydell
2019-08-16  5:16 ` Thomas Huth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).