g++ doesn't diagnose implicit int error

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Tue Jun 11 18:35:00 GMT 2019


On 2019-06-11 11:22, Achim Gratz wrote:
> Keith Thompson writes:
>> On Windows targets (including Cygwin and MinGW), the "-fms-extensions"
>> option is enabled by default.  This option enables certain Microsoft
>> extensions -- and apparently inhibits any diagnostics for implicit int.
>>
>> It is unfortunate, and arguably a bug, that this means that
>> "g++ -std=c++11 -pedantic" fails to diagnose implicit int errors.
>> I'm not sure whether this is a bug in gcc or in the way Windows
>> versions of gcc are built.
> 
> In the case of Cygwin it is quite certainly a bug as Cygwin is not a
> Windows target.

Seems like ms-extensions is enabled if the target is x86 with MS ABI, or
plan9-extensions is enabled. The former allows use of struct/union member names
the same as typedef names, and the latter allows passing pointers to
structs/unions and typedefs with anonymous fields, and referring to anonymous
fields declared using typedefs.

Cygwin may require these extensions to handle Windows structure definitions in a
Windows compatible way, to allow compilation of the Windows C and C++ modules
under winsup. That it enables C++ implicit int is unfortunate.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list