Article View: gnu.gcc.help
Article #54273Problems with protoize-1.02 and gcc-1.37.1 (Version OSF-1.9.2.14)
From: Knobi der Rechnerschrat
Date: Sat, 05 Jan 1991 13:36
Date: Sat, 05 Jan 1991 13:36
91 lines
4042 bytes
4042 bytes
Hello,
I've obtained the patches for Ron Guilmettes (rfg@mcc.com) protoize
package for automatic prototype generation. This patches are based on
Rev 1.35 of gcc. I applied them with some trouble, as the 1.37 based
OSF files are quite distant from the 1.35 files, and got a running
version. Unfortunately I've also got some problems with that stuff:
a) when using -fgen-prototypes together with -fsyntax-only, I get
core dumps from cc1. -fgen-prototypes modifies the tree structure
in one place. When I uncomment that stuff (which came with the
protoize patch), the core dump disappears. The offending code
came with this piece of patch:
***************
*** 875,883 ****
/* If declaring a type as a typedef, and the type has no known
! typedef name, install this TYPE_DECL as its typedef name. */
if (TREE_CODE (x) == TYPE_DECL)
if (TYPE_NAME (TREE_TYPE (x)) == 0)
TYPE_NAME (TREE_TYPE (x)) = x;
/* Multiple external decls of the same identifier ought to match. */
--- 879,907 ----
/* If declaring a type as a typedef, and the type has no known
! typedef name, install this TYPE_DECL node as its typedef name.
!
! If we are generating prototypes, and if the type being created in
! this typedef statement already has a name, we still have to preserve
! the information which associates the new (typedef'ed) name with the
! given type specification so that prototypes can be generated which will
! use names declared in typedef statements (as appropriate). In these
! (rare) cases where another name for the same type already exists, we
! clone the node which represents the type specification and make the
! clone's DECL_NAME equal to the (new) typedef name. */
!
if (TREE_CODE (x) == TYPE_DECL)
if (TYPE_NAME (TREE_TYPE (x)) == 0)
TYPE_NAME (TREE_TYPE (x)) = x;
+ else
+ if (flag_gen_prototypes)
+ {
+ tree copy = copy_node (TREE_TYPE (x));
+ if (TYPE_MAIN_VARIANT (TREE_TYPE (x)) = TREE_TYPE (x))
+ TYPE_MAIN_VARIANT (copy) = copy;
+ TREE_TYPE (x) = copy;
+ TYPE_NAME (copy) = x;
+ }
+
/* Multiple external decls of the same identifier ought to match. */
2) Suppose I have the following code:
typedef char *bla;
sbr_xxx(xxx)
char *xxx;
{}
In that case the genrated .p files says that the prototype for
sbr_xxx is 'int sbr_xxx(bla xxx)', which in my oppinion is not the
desired effect. If you are converting c-files and all your 'char *'
variables went into 'va_list's, because in some include-file va_list
is defined as 'char *', the result is rather confusing (even if the
code works perfect). The solution would be to change some code in
proto-gen.c, but I don't know where to look.
My questions are:
- are these problems already known?
- is there a newer version of protoize ou in netland that fits better
to gcc-1.37.
- any advise from some kind soul?
Regards
Martin Knoblauch
TH-Darmstadt ! Soon: Silicon Graphics Munich,
Physical Chemistry 1 ! network afddress yet unknown
Petersenstrasse 20 !
W-6100 Darmstadt, FRG !
BITNET: <XBR2D96D@DDATHD21>
FAX: (+int) 6151 16 4298
PHONE: (+int) 6151 16 2398
Technical Details
Message-ID:
<9101051336.AA01058@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!XBR2D96D%DDATHD21.BITNETShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,fa0f4e9b88a430a,start X-Google-Attributes: gid11318c,public X-Google-ArrivalTime: 1991-01-05 07:12:52 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!MITVMA.MIT.EDU!XBR2D96D%DDATHD21.BITNET From: XBR2D96D%DDATHD21.BITNET@MITVMA.MIT.EDU (Knobi der Rechnerschrat) Newsgroups: gnu.gcc.help Subject: Problems with protoize-1.02 and gcc-1.37.1 (Version OSF-1.9.2.14) Message-ID: <9101051336.AA01058@life.ai.mit.edu> Date: 5 Jan 91 13:36:45 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 91