home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!uunet.ca!canrem!telly!druid!darcy
- From: darcy@druid.uucp (D'Arcy J.M. Cain)
- Subject: Re: Macros for ANSI prototypes
- Message-ID: <1992Aug14.194033.10152@druid.uucp>
- Date: Fri, 14 Aug 1992 19:40:33 GMT
- References: <1992Aug12.051707.17509@organpipe.uug.arizona.edu> <3085@isgtec.isgtec.com>
- Organization: D'Arcy Cain Consulting
- Lines: 41
-
- robert@isgtec.com (Robert Osborne) writes:
- >dave@cs.arizona.edu (Dave Schaumann) writes:
- >> In stead of obfuscating your code with macros that turn on and off
- >> functio prototypes as the particular compiler requires, wouldn't it be
- >> better to simply include one of the tools freely available to
- >> automatically massage prototyped code into K&R acceptability.
- >
- >What if the code needs to be compiled simultaneously on eight
- >architecutures; 4 K&R and 4 ANSI?
-
- You may misunderstand what Dave (from *my* understanding) is saying. Just
- because you have an ANSI --> K&R converter doesn't mean that you throw
- away the ANSI code. The K&R code just becomes one of the stages of the
- compilation. For example, a standard compile might be:
-
- ANSI C --> Assembler --> a.out
-
- but for another system it becomes:
-
- ANSI C --> K&R C --> Assembler --> a.out
-
- You see the K&R is simply an intermediate stage and is thrown out after
- along with the .s and .o files. How you do this of course is a matter
- for you to set up in your own environment. As an example, I have hacked
- Gnu C to allow me to make Minix programs on my ANSI development system.
- The flow is:
-
- ANSI C (.c) --> K&R C (.m) --> Copy to Minix machine (.c) --> Compile
-
- This is all more or less automated.
-
- >Prototype checking is a great debugging tool; I'd hate to lose it
- >just because one of my architectures is K&R.
-
- And there is no need to.
-
- --
- D'Arcy J.M. Cain (darcy@druid.com) |
- D'Arcy Cain Consulting | There's no government
- Toronto, Ontario, Canada | like no government!
- +1 416 424 2871 DoD#0082 |
-