home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / os / os2 / programm / 7942 < prev    next >
Encoding:
Internet Message Format  |  1993-01-24  |  1.2 KB

  1. Path: sparky!uunet!olivea!hal.com!decwrl!csus.edu!netcom.com!ljensen
  2. From: ljensen@netcom.com (Colin Jensen)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Why I will choose Borland
  5. Message-ID: <1993Jan23.192929.21891@netcom.com>
  6. Date: 23 Jan 93 19:29:29 GMT
  7. References: <727547182.AA07615@tdkt.kksys.com>
  8. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  9. Lines: 28
  10.  
  11. In article <727547182.AA07615@tdkt.kksys.com> Scott.Jibben@f115.n282.z1.tdkt.kksys.com (Scott Jibben) writes:
  12. >  >>The most common example is disabling the
  13. >  >>parameter-not-used warning on vectored procedures...
  14. >
  15. >DM>And, fwiw, you can shut up those messages by casting the parameter to
  16. >  >void:
  17. >
  18. >Isn't it possible to turn off those warnings via a #pragma or something
  19. >like this:
  20. >
  21. >void foo( int )  // note: I removed the variable name.
  22. >{
  23. >  printf( "I like C.\n" );
  24. >  return
  25. >}
  26.  
  27. You program should really say
  28.     printf("I like C++.\n");
  29. since your method of shutting up warnings is only legal in C++, and is
  30. completly illegal in ANSI-C.
  31.  
  32. The most portable way to shut up the not-used warnings in ANSI-C
  33. is the cast to void trick which works for all of the compilers I have
  34. ever used.
  35.  
  36. -- 
  37. Colin Jensen
  38. ljensen@netcom.netcom.com    cjensen@ampex.com
  39.