ObjC RFA: Fix PR/6834 ObjC 3.1 regression

Neil Booth neil@daikokuya.demon.co.uk
Wed Jun 5 12:32:00 GMT 2002

Nicola Pero wrote:-

> @@ -43,6 +43,8 @@
>  #define LANG_HOOKS_DECODE_OPTION objc_decode_option
>  #define LANG_HOOKS_POST_OPTIONS c_common_post_options
> +#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
>  #define LANG_HOOKS_STATICP c_staticp
> Since I was reading that code, I compared the options defined in C/C++ and
> ObjC and I am also thinking that maybe
> #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.


More information about the Gcc-patches mailing list