Please consider not warning about using -fPIC on x86_64. The message is non-fatal and having an explicit exception to compile with mingw-w64 is overkill.
The correct fix is to remove -fpic from the command line. Not only does it do nothing, silencing it will imply it is actually an accepted argument.
This is bad practice and should be fixed on the user side.
I'm not sure I understand this logic. I'm asking for PIC, and getting PIC. That building without PIC is incorrect on this platform is secondary.
No other gcc flag generates a warning when the default is requested.
I'd tend to agree with Sean here. Now, if we hid a warning on -fno-pic (if such an option exists), that'd be a different story. But the paradigm of gcc has always been to silently accept redundant options.
I should explain better that PIC code has no place in PE, it is an ELF specific flag. So setting -fpic or -fno-pic is pointless on Windows.
Not emitting a warning is bad since it will lead to users to assume PIC is needed for Win64. This is blatantly false. __PIC__ and associated macros are not even defined if -fpic is used for mingw/Cygwin targets.
To add more, if we allow -fpic, it will only be a matter of time before somebody ask that all the associated __PIC__ macros are activated, this is plain wrong for Windows since there is no concept of PIC/PIE there.
IMHO, what you are asking will open a can of worms.
NS: There is no concept of PIC on Windows, this request is akin to hiding the symptom rather than fixing the problem.
Closing as later. Feel free to re-open if you believe this to have been in error.
No please, the warning is valid, -fpic is not something for win32 PE, the correct procedure is not to use it for mingw*.
In fact, I think it should be an error to use it, gcc should treat it as an unknown argument.