home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17663 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.4 KB  |  42 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!newsflash.concordia.ca!mizar.cc.umanitoba.ca!umfehr06
  3. From: umfehr06@ccu.umanitoba.ca (John Fehr)
  4. Subject: Re: wierd sas/c bug
  5. Message-ID: <BzMGn8.370@ccu.umanitoba.ca>
  6. Sender: news@ccu.umanitoba.ca
  7. Nntp-Posting-Host: ccu.umanitoba.ca
  8. Organization: University of Manitoba, Winnipeg, Canada
  9. References: <BzIw0y.n31@ccu.umanitoba.ca> <BzM6F7.E6K@unx.sas.com>
  10. Date: Mon, 21 Dec 1992 18:28:19 GMT
  11. Lines: 29
  12.  
  13. In <BzM6F7.E6K@unx.sas.com> walker@twix.unx.sas.com (Doug Walker) writes:
  14. >Please post a COMPILABLE example.  I can virtually guarantee that this
  15. >is not a compiler bug.  A compiler that broken would not compile
  16.  
  17. OK... here's a compilable example: (hopefully I'll type it in right this
  18. time. :)
  19.  
  20. #include <stdio.h>
  21. #undef WHATEVER "test"
  22.  
  23. char dummy[100]="another test";
  24.  
  25. main() {
  26.   printf("dummy='%s'\n",dummy);
  27. }
  28.  
  29. That SHOULD (it does for me) print out something totally unexpected.
  30. What's almost as wierd, is if you #include something after the
  31. #undef.  (an empy .h file will do)
  32. I know that #undef WHATEVER "test" isn't ANSI-compliant (the HP-compiler
  33. complanes about it anyway) but some programs actually have that in
  34. their code.
  35.    John
  36.  
  37. -- 
  38. -----------------------------------------------------
  39. -  John Fehr                        -    DoD#505    -
  40. -  umfehr06@ccu.umanitoba.ca        -    GPz550     -
  41. -  umfehr06@silver.cs.umanitoba.ca  -  A3000 kicks! -
  42.