Xref: utzoo comp.lang.c:34438 comp.std.c:3987 Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!lavaca.uh.edu!menudo.uh.edu!sugar!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c,comp.std.c Subject: Re: ANSI C -> non-ANSI C Message-ID: Date: 2 Dec 90 14:08:37 GMT References: <90335.163132TRM900@psuvm.psu.edu> <14630@smoke.brl.mil> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 35 [ cross-posted to comp.std.c, because a tool like this would do more to speed the conversion of software to ANSI than all the debate in the world. Perhaps someone on the committee could do it in their copious spare time... :-> ] > >Is there any software available to translate ANSI C to non-ANSI C? > More seriously, you should be more specific about the problem > that you think you're trying to solve. Is it to eliminate > parameters from prototypes in function declarations, or is it > something more difficult? I'd like some software to convert new- to old- style declarations myself. None of the deproto tools I've seen so far do an adequate job, because while they clean up the prototypes they don't clean up all the calls. For example, if you want to run ANSI C through a K&R compiler, you need to change: int foo(char *, char *, int); char bazbuffer[BUFSIZ]; foo(NULL, bazbuffer, 69); Into: int foo(); foo((char *)0, bazbuffer, 69); Just removing the prototypes isn't enough. To do this right you pretty much need a complete codewalker, so it might be cheaper just to go out and get a new compiler. Unfortunately, sometimes one isn't available, and ignoring the older systems is just going to ensure that islands of pre-ANSI C live forever in dusty decks, waiting to catch the unwary. Also, this hypothetical tool *would* just have to be written once. It doesn't have any reason to do any machine-dependent stuff. -- Peter da Silva. `-_-' +1 713 274 5180. 'U` peter@ferranti.com Brought to you by Super Global Mega Corp .com