I need to create ANSI C function prototypes.
Lloyd Zusman, Master Byte Software
fxgrp!ljz at ames.arpa
Tue Feb 16 05:35:49 AEST 1988
In article <1183 at orcisi.UUCP> michael at orcisi.UUCP (Michael Herman) writes:
>> Take the lint shell file. Make a copy. Modify it so that it saves
>> the output of the "lint1" pass. Delete the lint2 pass. Run it on
>> the sources you want to have lint libraries for. Viola! The stuff
>> you saved is the lint library. ...
>
> ...
>
>Under MS-DOS, the MS C compiler has a -Zg option which writes the prototypes
>of the supplied source file to stdout.
Thanks to all the people who responded to this question of mine.
Unfortunately, in my original question I mentioned the Microsoft C
compiler under MSDOS and rejected it, as this MUST run under Unix.
The purpose for my query was NOT to come up with an aid to building
lint libraries. We want to be able to port our code from
"old-fashined" C to ANSI C, and that is what motivated my query.
But I will still explore this approach.
Judging from the responses I have gotten, this is a more difficult
problem than I had first imagined.
Something has occurred to me, however. Recently, someone posted the a
yacc grammar for ANSI C to one of the comp.sources newsgroups. After
scratching my head a while, I realized that a yacc grammar for
"old-fashioned" C could be very helpful for me in solving this
function-prototype problem: I could use it to positively locate
function definitions and then a relatively small amount of parsing
could isolate the rest of the information I need to generate the
function prototypes I desire.
So, does anyone have a yacc grammar for "old-fashioned" C that he or she
would be willing to send to me? I'm very weak on grammars, but once
I have one, I could use it in creating a program that builds ANSI C
function prototypes from "old-fashioned" C code. I would then gladly
post the finished product to comp.sources.whatever.
---
Lloyd Zusman
Master Byte Software
Los Gatos, California Internet: fxgrp!ljz at ames.arpa
"We take things well in hand." UUCP: ...!ames!fxgrp!ljz
More information about the Comp.unix.questions
mailing list