home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / c / 12355 < prev    next >
Encoding:
Text File  |  1992-08-14  |  1.9 KB  |  52 lines

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