This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: ObjC-specific changes to c-typeck.c
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Ziemowit Laski <zlaski at apple dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 23 Aug 2004 18:05:05 -0700
- Subject: Re: PATCH: ObjC-specific changes to c-typeck.c
- References: <35074ADC-F53E-11D8-9720-000393673036@apple.com>
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