This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- From: "gdr at cs dot tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2006 04:01:03 -0000
- Subject: [Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations
- References: <bug-25814-5307@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from gdr at cs dot tamu dot edu 2006-01-17 04:01 -------
Subject: Re: Request for warning for parser ambiguity of function declarations
and variable declarations with initializations
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Maybe if more C++ books actually talked about this issue, there would not be
a
| problem (sorry I could not resists).
C++ books do take about it -- just check out the good ones. This very
problem, if you check out writings from Bjarne or me (see, e.g.,
our proposal for "generalized initializer list" for discussions), is a
problem inherited from the C syntax which permits redundant
parenthesis in declarations, exacerbed by the functional notation.
Check out details from D&E.
| Also warning about very valid and defined
| code even if it is a common mistake that beginers make. I would rather have
| people actually taught this rule than GCC warning about it.
this is somehow hard to diagnose, but I guess one could engineer the
front-end to remember redundant parens, but it would be rather low
priority for me.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25814