This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Make ObjC an extension of C
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: Ziemowit Laski <zlaski at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 8 Aug 2002 23:19:24 +0100
- Subject: Re: PATCH: Make ObjC an extension of C
- References: <5DCC9BC6-AB1B-11D6-8561-000393673036@apple.com>
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.