#1028580 gcc-mingw-w64: i686-w64-mingw32-gcc reports wrong version in __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__

#1028580#5
Date:
2023-01-13 07:44:46 UTC
From:
To:
Dear Maintainer,

i686-w64-mingw32-gcc reports wrong version in __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__.

The package has version 12.2.0-14+25.2, while GCC itself reports itself as 12.0.0.
Native GCC behaves correctly.

```
manx@appendix:~/tmp$ cat foo.c
#include <stdio.h>
int main() {
    printf("%i.%i.%i\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
}
manx@appendix:~/tmp$ i686-w64-mingw32-gcc -std=c17 -O3 -Wall -Wextra -Wpedantic foo.c
manx@appendix:~/tmp$ ./a.exe
0080:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0080:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0080:err:systray:initialize_systray Could not create tray window
12.0.0
manx@appendix:~/tmp$ gcc -std=c17 -O3 -Wall -Wextra -Wpedantic foo.c
manx@appendix:~/tmp$ ./a.out
12.2.0
manx@appendix:~/tmp$ i686-w64-mingw32-gcc-posix --version
i686-w64-mingw32-gcc-posix (GCC) 12-posix
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```