This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/25814] Request for warning for parser ambiguity of function declarations and variable declarations with initializations



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]