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: Make ObjC an extension of C


Ziemowit Laski wrote:-

> diff -c -3 -p -r1.227 cpplib.h
> *** gcc/cpplib.h        23 Jul 2002 22:57:44 -0000      1.227
> --- gcc/cpplib.h        7 Aug 2002 21:01:22 -0000
> *************** enum cpp_ttype
> *** 154,159 ****
> --- 154,160 ----
>   /* C language kind, used when calling cpp_reader_init.  */
>   enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_STDC89, CLK_STDC94, 
> CLK_STDC99,
>              CLK_GNUCXX, CLK_CXX98, CLK_ASM};
> + extern int compiling_objc;

Come on, Zem, you should know better than this.  cpplib is a re-
entrant library, no statics are allowed unless valid across all
instances (which basically leaves only those to do with library
initialization).  You must have noticed that there are no others.

The current flags in cpplib handle ObjC perfectly - why do you feel the
need to change them?  cpplib already, unlike the compiler front ends,
treats ObjC as a dialect on top of C or C++, not as an alternative.

> + objc_init_options ()
> + {
> +   compiling_objc = 1;
> + #ifdef OBJCPLUS
> +   cxx_init_options (clk_cplusplus);
> + #else
> +   c_common_init_options (clk_c);
> + #endif
> + }

I'm not sure introducing these #ifdef's is a good idea yet; we don't
have ObjC++.  You should be able to convert the existing FSF code
without introducing bits of the future.

Neil.


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