This is the mail archive of the gcc-patches@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]

Re: PATCH RFA: C++ frontend: Don't warn about shifts which will not be run


Jason Merrill wrote:
> On 06/12/2009 09:01 PM, Ian Lance Taylor wrote:
>> Suppose we eliminate skip_evaluation from the C and C++ frontends, since
>> it seems to be poorly named, and replace it with "c_parsing_sizeof_arg"
>> (which would also apply to typeof and alignof; better names solicited)
>> and "c_never_executed".
> 
> This makes sense to me.  For the former, the C++ standard term is
> "unevaluated operand".  I'd rather not use the word "parsing" since we
> look into these expressions during template substitution as well.

I agree with Jason.  I can't think of a better name than
"c_unevaluated_operand", and I think that's a pretty good name; put a
comment on the function of course. :-)

In general, I wish that we had a clearer policy regarding warnings.
Sometimes, people want warnings about code that will never be executed
(because they want to avoid introducing problems when building other
configurations of their software); other times, they don't.  We're
hard-coding this kind of stuff into the warning machinery, without
really stating a clear policy about what we intend (that we care only
about one of these scenarios, that we think users should get to pick, or
that we think that warnings meeting some criteria should be issued no
matter what, while others should be dependent on whether the code is
reachable).

But, in the short term, I agree that making the C++ front end match the
C front end is a good thing.  C is our most popular language and most of
these differences between C and C++ are the result of having two largely
separate front ends, rather than any kind of conscious design decision.
 The more code/behavior we can share, the better.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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