home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / c / 13290 < prev    next >
Encoding:
Text File  |  1992-09-08  |  980 b   |  50 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!mcsun!sun4nl!wn1.sci.kun.nl!cs.kun.nl!hansm
  3. From: hansm@cs.kun.nl (Hans Mulder)
  4. Subject: I disagree with lint(1)
  5. Message-ID: <1992Sep7.083401.2587@sci.kun.nl>
  6. Summary: Lint(1) says this is wrong.  Is it?
  7. Keywords: lint, classic C
  8. Sender: news@sci.kun.nl (NUnet News Owner)
  9. Organization: University of Nijmegen, The Netherlands
  10. Date: Mon, 7 Sep 1992 08:34:01 GMT
  11. Lines: 37
  12.  
  13. Hello C gurus,
  14.  
  15. I just asked lint(1)'s opinion on this piece of code:
  16.  
  17. typedef struct foo *bar;
  18.  
  19. fun(b)
  20. bar b;
  21. {
  22.     b=b;
  23. }
  24.  
  25. struct foo
  26. {
  27.     int i;
  28. }   the_struct;
  29.  
  30. main()
  31. {
  32.     fun(&the_struct);
  33.     return 0;
  34. }
  35.  
  36. Lint(1) says:
  37.  
  38. fun, arg. 1 used inconsistently    foo.c(5)  ::  foo.c(16)
  39.  
  40. I disagree.  The first argument to fun is a pointer to struct foo on both
  41. lines.  In my book, that's the same.
  42.  
  43. What do you all think?
  44.  
  45. In case the answers for Standard C and Classic C are different, I'm
  46. interested in the answer for Classic C.
  47.  
  48. --
  49. Hans Mulder            hansm@cs.kun.nl
  50.