NEWBIE: new crashes, have info... (fwd)

From: Billy H. Chan (bhchan@po.EECS.Berkeley.EDU)
Date: 05/13/96


From: zero@baker.cnw.com
To: CircleMUD Mailing List <circle@pvv.unit.no>

  I got a couple errors i did not recognize when it compiled but they were 
  only warnings so i ignored them:

  act.informative.c: In function `do_who':
  act.informative.c:1000: warning: format argument is not a pointer (arg 3)
  act.informative.c:1000: warning: int format, pointer arg (arg 8)
  act.informative.c:1000: warning: too few arguments for format

NEVER EVER IGNORE WARNINGS... for instance, if you had not ignored them,
you would've gone to arg 3 and saw that it's not a %s but a GET_LEVEL...
At which point, you would've realized you forgot the 'buf' again (as I've
done lots myself...) #include SMILEY.h
Warnings are your tools against silly bugs... :)  Please use them.
However, very good on reporting both warnings, code, and gdb bt.
(Dare I say, "Good Newbie"?  (how arrogant I sound))
-- Billy  H. Chan     bhchan@po.eecs.berkeley.edu  bhchan@csua.berkeley.edu
   CogSci/CompSci     http://www.csua.berkeley.edu/~bhchan     ResumeInside

CODE FOLLOWS:
 
  the code near those lines is as follows:

  994 } else {
  995   num_can_see++;
  996   sprintf(buf, "%s[%2d %2d %2d %2d %2d] %s %s",

<code snipped>
HERE IS WHERE THE buf IS NEEDED (arg3 in 996, but gcc reports at the
end of a line, which is 1000...



This archive was generated by hypermail 2b30 : 12/18/00 PST