public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Keith Thompson <Keith.S.Thompson@gmail.com>
To: cygwin@cygwin.com
Cc: Keith Thompson <Keith.S.Thompson@gmail.com>
Subject: Re: g++ doesn't diagnose implicit int error
Date: Tue, 11 Jun 2019 07:48:00 -0000	[thread overview]
Message-ID: <CAAHpriNaC5YMpuBkNuf92ABTZUAxJ6xi8pQo3kxuxNgqSywPFA@mail.gmail.com> (raw)
In-Reply-To: <CAAHpriO62Lhm9-eGrmA17gFZNFGLEeUrAmeKE+yNvhvBjFgRAA@mail.gmail.com>

I believe this answer by user "M.M" on Stack Overflow explains the issue:
https://stackoverflow.com/a/56537459/827263

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.

Meanwhile, this can be worked around by using "g++ -fno-ms-extensions ...".
This which might cause problems when compiling some Windows headers,
but M.M reports being able to compile some large Windows projects
this way without running into problems.

There's also a "-fms-extensions" option for C, but gcc warns about
implicit int declarations in C with or without that option.

--
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  7:48 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 [this message]
2019-06-11 17:22   ` Achim Gratz
2019-06-11 18:35     ` Brian Inglis

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=CAAHpriNaC5YMpuBkNuf92ABTZUAxJ6xi8pQo3kxuxNgqSywPFA@mail.gmail.com \
    --to=keith.s.thompson@gmail.com \
    --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).