Path: utzoo!mnetor!uunet!amdahl!ames!fxgrp!ljz From: fxgrp!ljz@ames.arpa (Lloyd Zusman, Master Byte Software) Newsgroups: comp.unix.questions Subject: Re: I need to create ANSI C function prototypes. Message-ID: <202@fxgrp.UUCP> Date: 15 Feb 88 19:35:49 GMT References: <201@fxgrp.UUCP> <2273@cognos.UUCP> <445@spectrix.UUCP> <1183@orcisi.UUCP> Sender: ljz@fxgrp.UUCP Reply-To: fxgrp!ljz@ames.arpa (Lloyd Zusman, Master Byte Software) Followup-To: <1183@orcisi.UUCP> michael@orcisi.UUCP (Michael Herman) Organization: FX Development Group, Inc., Mountain View, CA Lines: 44 In article <1183@orcisi.UUCP> michael@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@ames.arpa "We take things well in hand." UUCP: ...!ames!fxgrp!ljz