[Prev][Next][Index]
re: Converting `C' files with c2dep
- From: Andrew Mauer <mauer@mcs.anl.gov>
- Date: Thu, 23 Jun 1994 15:42:35 -0500
- To: mustaf@engr.uky.edu (Mustafa)
- Cc: sage-bugs@cica.indiana.edu, sage-users@cica.indiana.edu
- Subject: re: Converting `C' files with c2dep
- In-Reply-To: <9406232001.AA24692@s.ecc.engr.uky.edu>
- References: <9406232001.AA24692@s.ecc.engr.uky.edu>
>>>>> "Mustafa" == Mustafa <mustaf@engr.uky.edu> writes:
Mustafa> I started using sage++ for some program
Mustafa> restructuring. I'm not able to convert any 'C' files to .dep
Mustafa> files using c2dep. Can you tell me how to do that. I would
Mustafa> appreciate your help.
I would *strongly* recommend you not try to use `c2dep'. My impression
is that it is quite broken. For instance, it does not handle "float"
or "double" declarations, even in trivial programs. Other users have
reported problems with parsing `typedef' and with braces not being
correctly inserted in if statements. Since I work with numerical
codes, the first problem kills me.
If you can use ANSI C, I would suggest using pC++2dep, which will
translate ANSI C since that is a subset of C++.
If you have K&R C programs that are not ANSI C, you can convert them
to ANSI C and then use pC++2dep. I have successfully done this with
several K&R C programs by using the `protoize' program that is
distributed with GNU C. For most programs, this is quite easy. One of
my problems has everything in one directory, so I just ran:
protoize *.c
to convert everything.
Also note that you cannot run `pC++2dep' on source files that contain
#includes. This was recently discussed, but only on the sage-bugs
list. You need to process the files with `cc -E' or the equivalent.
The process will look something like this:
$ cc -E main.c > main-processed.c
$ pC++2dep main-processed.c
$ ./your-transformation main-processed.proj
Later you may want to "de-include" these files; I use a crude strategy
for doing this that I hope to clean up and post to the sage-users list
by early next week.
/Andrew/