public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
To: cygwin@cygwin.com
Subject: Re: g++ doesn't diagnose implicit int error
Date: Tue, 11 Jun 2019 18:35:00 -0000	[thread overview]
Message-ID: <d2cc873c-b63d-3741-e092-6a565fec2fac@SystematicSw.ab.ca> (raw)
In-Reply-To: <87imtcnik5.fsf@Rainer.invalid>

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

      reply	other threads:[~2019-06-11 18:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-10  4:38 Keith Thompson
2019-06-11  7:48 ` Keith Thompson
2019-06-11 17:22   ` Achim Gratz
2019-06-11 18:35     ` Brian Inglis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2cc873c-b63d-3741-e092-6a565fec2fac@SystematicSw.ab.ca \
    --to=brian.inglis@systematicsw.ab.ca \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).