home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #23 / NN_1992_23.iso / spool / gnu / gcc / help / 2290 < prev    next >
Encoding:
Internet Message Format  |  1992-10-09  |  1.7 KB

  1. Path: sparky!uunet!ferkel.ucsb.edu!taco!bu.edu!rpi!ghost.dsi.unimi.it!itnsg1.cineca.it!lele
  2. From: lele@itnsg1.cineca.it (Lele Gaifax)
  3. Newsgroups: gnu.gcc.help
  4. Subject: GCPP extension
  5. Message-ID: <1992Oct9.144505.20396@itnsg1.cineca.it>
  6. Date: 9 Oct 92 14:45:05 GMT
  7. Organization: Laboratorio di Fisica Computazionale, INFM. Trento Italia
  8. Lines: 41
  9.  
  10. I was wondering on this for enough time... 
  11. From the GNU point of view, is there valid reason to not extend the #define
  12. syntax so to avoid using backslashes to build a long definition? Maybe an 
  13. example would be clear:
  14.  
  15. Often we use definition like this
  16.  
  17. #define foobar(arg_one, arg_two)    { \
  18.                       if (dummy_function (arg_one)) \
  19.                         arg_two = other_dummy (arg_two); \
  20.                       else \
  21.                         arg_two = arg_one; \
  22.                     }
  23.  
  24. this is very difficult to edit, boring, and often one forget the backslash, ...
  25. so why not extend the preproc to handle a more complex construct like
  26.  
  27. #defmacro foobar(arg_one, arg_two)    {
  28.                       if (dummy_function (arg_one)) 
  29.                         arg_two = other_dummy (arg_two); 
  30.                       else 
  31.                         arg_two = arg_one; 
  32.                     }
  33. #endmacro
  34.  
  35. And since this would be a GNU extension to the C language, it should disappear
  36. if the compiler gets invoked with --ansi or similar... 
  37.  
  38. To quote the GNU standards:
  39.    "Much of what is called "portability" in the Unix world refers to
  40. porting to different Unix versions.  This is a secondary consideration
  41. for GNU software, because its primary purpose is to run on top of one
  42. and only one kernel, the GNU kernel, compiled with one and only one C
  43. compiler, the GNU C compiler."
  44.  
  45. thanx for you opinion,
  46. lele.
  47. -- 
  48. Lele Gaifax - lele@itnsg1.cineca.it
  49. ...calling Emacs convenient, of course, is like calling oxygen useful
  50.                     Rens Troost
  51.