This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Ping Re: [4.5] Ping two patches
Joseph S. Myers wrote:
>> My only concern with the other patch is the c_fully_fold interface,
>> which has been implemented as a no-op in C++.
>>
>> In other words, what I'm questioning here is whether this is actually an
>> interface that we can affect all C-ish front-ends to implement, or
>> whether we should say that it is only for C (and Objective-C?), but not
>> for C++ (or Objective-C++).
>
> It should do nothing for C++ while C++ folds during parsing; it can't even
> be called for C++ at present (but is required for linking because of a
> C-conditional call in common code).
In that case, I think the comment on the C++ version should not just
state what it does -- but that this is what it should do. As written,
it begs the question "Should we be doing something different with this
hook in C++?" And, if it's actually unreachable, then instead of being
a no-op it should contain a call to gcc_unreachable.
But, if it's eventually going to move into common code, then I think it
would be even better just to put it there now. Check c_dialect at the
top of the function and call gcc_unreachable if the dialect is a C++,
with a comment explaining why this isn't useful in C++. Then, when C++
grows what it needs to take advantage, we'll have a place to put the
support we need.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713