From: "Jonathan Wakely" <jwakely.gcc@gmail.com>
To: "Mark Mitchell" <mark@codesourcery.com>
Cc: "Joe Buck" <Joe.Buck@synopsys.com>,
"Jason Merrill" <jason@redhat.com>,
"Ian Lance Taylor" <iant@google.com>,
"Manuel López-Ibáñez" <lopezibanez@gmail.com>,
"Ismail Dönmez" <ismail@pardus.org.tr>,
gcc@gcc.gnu.org
Subject: Re: Changes in C++ FE regarding pedwarns to be errors are harmful
Date: Sat, 12 Jan 2008 19:07:00 -0000 [thread overview]
Message-ID: <4348dea50801121013s33dd45f2r4579693855c005e7@mail.gmail.com> (raw)
In-Reply-To: <4787AD8B.9080006@codesourcery.com>
On 11/01/2008, Mark Mitchell wrote:
>
> Exactly so. I think that we have two kinds of pedwarns: those that are
> pedantic in the sense we use for C (like, that there cannot be a naked
> semicolon at the top-level of a file, or that "long long" is not in
> C++98) and those that refer to semantically reasonable constructs that
> we previously accepted, often because they were allowed by cfront or the
> ARM. With flag_permissive, we probably want the latter category to be
> warnings at most; without flag_permissive, we want them to be errors.
I'll start the ball rolling with cp/call.c, cp/class.c and cp/cvt.c
I'll call the latter category isowarns for the purpose of this mail,
they are technically illegal constructs that are errors without
-fpermissive. My suggestion of pedwarn/isowarn given in capitals on
each entry.
call.c:3258 build_conditional_expr PEDWARN
"ISO C++ forbids omitting the middle term of a ?: expression."
GNU extension, currently allowed unless -pedantic.
call.c:3867 build_new_op ISOWARN
"no 'operator++(int)' declared for postfix '++', trying prefix operator instead"
This should not be accepted without -fpermissive
call.c:4352 convert_like_real ISOWARN
pedwarn ("invalid conversion from %qT to %qT", TREE_TYPE (expr), totype);
if (fn)
pedwarn (" initializing argument %P of %qD", argnum, fn);
Not sure about this one ... isowarn I think.
call.c:4953 build_over_call ISOWARN
"passing 'const X' as 'this' argument of 'void X::f()' discards qualifiers"
call.c:6463 joust PEDWARN
"ISO C++ says that these are ambiguous, even though the worst
conversion for the first is better than the worst conversion for the
second:"
GNU extension, currently entirely disallowed by -pedantic, otherwise pedwarn.
I think that's OK.
class.c:2483 finish_struct_anon ISOWARN
""%q+#D invalid; an anonymous struct can only have non-static data members"
"private member %q+#D in anonymous struct"
(and similarly for anonymous unions adn protected members)
Not sure how to trigger this, but I don't think is is intended as a
GNU extension so should require -fpermissive
class.c:3037 check_field_decls ISOWARN
"field 'int S::S' with same name as class"
class.c:5995 resolve_address_of_overloaded_function ISOWARN
"assuming pointer to member %qD (a pointer to member can only be
formed with %<&%E%>)"
class.c:6358 note_name_declared_in_class ISOWARN
"declaration of 'i'
changes meaning of 'i' from '<anonymous enum> i'"
cvt.c:382 warn_ref_binding ISOWARN
"initialization of non-const reference type %q#T from rvalue of type %qT"
cvt.c:452 convert_to_reference ISOWARN
"conversion from %qT to %qT discards qualifiers"
cvt.c:656 ocp_convert ISOWARN
"conversion from %q#T to %q#T"
cvt.c:902 convert_to_void ???
"statement cannot resolve address of overloaded function"
Shouldn't this be a hard error? What benefit is there to allowing
this with -fpermissive?
Jon
next prev parent reply other threads:[~2008-01-12 18:13 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 21:27 Ismail Dönmez
2008-01-08 21:34 ` Joe Buck
2008-01-08 21:43 ` Richard Guenther
2008-01-08 21:44 ` Ismail Dönmez
2008-01-08 22:13 ` Andrew Pinski
2008-01-08 22:29 ` Manuel López-Ibáñez
2008-01-08 22:36 ` Ismail Dönmez
2008-01-08 22:45 ` Andrew Pinski
2008-01-09 14:10 ` Paolo Bonzini
2008-01-09 15:38 ` Manuel López-Ibáñez
2008-01-09 15:57 ` Paolo Bonzini
2008-01-08 22:51 ` Manuel López-Ibáñez
2008-01-08 23:02 ` Ismail Dönmez
2008-01-09 1:23 ` Ismail Dönmez
2008-01-09 2:25 ` Manuel López-Ibáñez
2008-01-09 16:47 ` Ian Lance Taylor
2008-01-09 18:11 ` Benjamin Kosnik
2008-01-09 18:18 ` Andrew Pinski
2008-01-09 18:21 ` Paolo Carlini
2008-01-09 19:42 ` Mark Mitchell
2008-01-11 17:06 ` Jason Merrill
2008-01-11 17:12 ` Joe Buck
2008-01-11 17:55 ` Mark Mitchell
2008-01-12 19:07 ` Jonathan Wakely [this message]
2008-01-12 19:50 ` Manuel López-Ibáñez
2008-01-13 3:28 ` Jonathan Wakely
2008-01-13 15:30 ` Manuel López-Ibáñez
2008-01-13 22:56 ` Jonathan Wakely
2008-01-14 2:04 ` Jonathan Wakely
2008-01-14 2:19 ` Manuel López-Ibáñez
2008-01-13 15:33 ` Gabriel Dos Reis
2008-01-13 15:36 ` Ismail Dönmez
2008-01-13 16:09 ` Andreas Schwab
2008-01-13 16:10 ` Ismail Dönmez
2008-01-13 16:13 ` Richard Guenther
2008-01-13 16:41 ` Ismail Dönmez
2008-01-13 23:08 ` Manuel López-Ibáñez
2008-01-14 11:03 ` Paolo Bonzini
2008-01-14 16:23 ` Ismail Dönmez
2008-01-13 16:43 ` Gabriel Dos Reis
2008-01-13 16:45 ` Ismail Dönmez
2008-01-13 19:17 ` Gabriel Dos Reis
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=4348dea50801121013s33dd45f2r4579693855c005e7@mail.gmail.com \
--to=jwakely.gcc@gmail.com \
--cc=Joe.Buck@synopsys.com \
--cc=gcc@gcc.gnu.org \
--cc=iant@google.com \
--cc=ismail@pardus.org.tr \
--cc=jason@redhat.com \
--cc=lopezibanez@gmail.com \
--cc=mark@codesourcery.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).