This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ObjC RFA: Fix PR/6834 ObjC 3.1 regression
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Nicola Pero <nicola at brainstorm dot co dot uk>
- Cc: shebs at apple dot com, Ovidiu Predescu <ovidiu at cup dot hp dot com>,gcc-patches at gcc dot gnu dot org, benhur at inf dot ufsm dot br
- Date: Wed, 5 Jun 2002 20:25:15 +0100
- Subject: Re: ObjC RFA: Fix PR/6834 ObjC 3.1 regression
- References: <Pine.LNX.4.21.0206051433020.26785-100000@nicola.brainstorm.co.uk>
Nicola Pero wrote:-
> @@ -43,6 +43,8 @@
> #define LANG_HOOKS_DECODE_OPTION objc_decode_option
> #undef LANG_HOOKS_POST_OPTIONS
> #define LANG_HOOKS_POST_OPTIONS c_common_post_options
> +#undef LANG_HOOKS_GET_ALIAS_SET
> +#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
> #undef LANG_HOOKS_STATICP
> #define LANG_HOOKS_STATICP c_staticp
> #undef LANG_HOOKS_PRINT_IDENTIFIER
>
> Since I was reading that code, I compared the options defined in C/C++ and
> ObjC and I am also thinking that maybe
>
> #undef LANG_HOOKS_SAFE_FROM_P
> #define LANG_HOOKS_SAFE_FROM_P c_safe_from_p
>
> should be added to objc-lang.c too.
I agree both should be there. There is little reason for the C and ObjC
hooks to differ, apart from trivially (and they would be mostly the
initialization hooks).
I think it might be an idea to split the c hooks into a separate file,
and have c-lang.c include them, and objc-lang.c include them too, but
then override the (at most) 2 or 3 it needs to have different. This
would avoid this class of bugs in the future - people find it to easy
to modify c-lang.c and forget about objc-lang.c.
Neil.