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: ObjC-specific changes to c-typeck.c


Ziemowit Laski <zlaski@apple.com> writes:

> The current patch contains the mod needed for c-typeck.c.  The problem
> was that casts to ObjC types (e.g., '(Object <Proto> *)foo') were
> sometimes getting "optimized away" by build_c_cast().  This led to
> problems when constructing message expressions (e.g., '[(Object
> <Proto> *)foo msg]'), where not knowing the user-intended type for the
> receiver led to incorrect diagnostics, or worse yet, incorrect codegen
> (if an ABI-incompatible method signature were to be selected).

My knee-jerk reaction is that the type of the underlying DECL should
be set correctly in the first place, so that the conversion is
unnecessary.  If for some reason that is impossible, then the
conversion should not be sent through build_c_cast (since it does not
have the semantics of a C cast).  

However, there may be some good reason why it has to be done this way.
I would suggest you get Joseph Myers to look at this; he's more
familiar with c-typeck.c's intricacies than I am.

zw


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