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
>  #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.



More information about the Gcc-patches mailing list