This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch partially fixing the ObjC -gen-decls option
- From: Stan Shebs <shebs at apple dot com>
- To: Nicola Pero <nicola at brainstorm dot co dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 02 Sep 2002 12:56:25 -0700
- Subject: Re: Patch partially fixing the ObjC -gen-decls option
- References: <Pine.LNX.4.21.0208301140130.18825-100000@nicola.brainstorm.co.uk>
Nicola Pero wrote:
While documenting the ObjC options, I found about the -gen-decls option,
and I had a look at it, but it looks like it is horribly buggy :-(
While reading the code, I tidied it up a little, fixed some stuff, and
commented some rough bits. I didn't too much, anyway with this patch it
works definitely much better for me. Before, it didn't work at all.
Ok to apply ?
Fri Aug 30 01:49:42 2002 Nicola Pero <n.pero@mi.flashnet.it>
* objc/objc-act.c (dump_interface): Enlarged the char * buffer to
1024 chars. Fixed category dumping - print out category names
with the proper syntax. Print '@end\n' and not '\n@end' at the
end of the interface.
(finish_objc): Fixed the -gen-decls option. It was printing out
only the last class. Dump an interface declaration of all classes
being compiled instead.
This is OK, but I would suggest bumping the fixed-size buffer up to
10K or more. Dynamic resizing would of course be better, but it's
not clear if it's worth that much trouble in this context.
One thing that comes to mind - why does this option exist? I don't
know of a rationale, and it's never used by anybody. My best guess
is that it might have been used to generate headers once upon a time.
Anyway, if its only remaining interest is for debugging, it might be
worthwhile to think about folding it into C pretty-printing.
Stan