home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / hp / 10051 < prev    next >
Encoding:
Text File  |  1992-09-04  |  2.4 KB  |  81 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!mcsun!Germany.EU.net!math.fu-berlin.de!zrz.tu-berlin.de!jaenicke
  3. From: jaenicke@emserver.ee.tu-berlin.de (Lutz Jaenicke)
  4. Subject: Re: that HPUX cc compiler
  5. Message-ID: <P7O63VN@mailgzrz.tu-berlin.de>
  6. Sender: news@mailgzrz.tu-berlin.de (News Manager)
  7. Nntp-Posting-Host: emws1.ee.tu-berlin.de
  8. Organization: TU-Berlin, Institut fuer Elektrische Maschinen
  9. References: <1992Aug31.104950.1108@bohra.cpg.oz.au> <4722@prcrs.prc.com>
  10. Date: Fri, 4 Sep 1992 12:59:53 GMT
  11. Lines: 68
  12.  
  13. In article <4722@prcrs.prc.com> paul@prcrs.prc.com (Paul Hite) writes:
  14. >--------------
  15. >#include <stdio.h>
  16. >#include <sys/stat.h>
  17. >#include <utmp.h>
  18. >#include <time.h>
  19. >time_t bogus;
  20. >main ()
  21. >{
  22. >    FILE *u;
  23. >    struct utmp entry;
  24. >    u = fopen("/etc/utmp","r");
  25. >    while(fread(entry, sizeof entry, 1, u)) {
  26. >        bogus = entry.ut_time;
  27. >        printf("bogus = %d\n");
  28. >    }
  29. >    fclose(u);
  30. >    exit(0);
  31. >}
  32.  
  33. # cc -Aa -D_HPUX_SOURCE paul.c
  34. cc: "a.c", line 11: error 1718: Types are not assignment-compatible.
  35. cc: "a.c", line 11: warning 563: Argument #1 is not the correct type.
  36. # lint paul.c
  37.  
  38. a.c
  39. ==============
  40. (17)  warning: 'main' returns random value to invocation environment
  41.  
  42.  
  43. ==============
  44. value type declared inconsistently
  45.     exit       llib-lc(235) :: a.c(16)
  46. function argument ( number ) used inconsistently
  47.     fread( arg 1 )       llib-lc(170) :: a.c(11)
  48. function returns value which is always ignored
  49.     fclose        printf    
  50. # lint -Aa -D_HPUX_SOURCE paul.c
  51.  
  52. a.c
  53. ==============
  54. (11)  types in call and definition of 'fread' are incompatible for parameter
  55.    '#1'
  56. (17)  warning: 'main' returns random value to invocation environment
  57. warning: function prototype not visible at point of call:
  58.     (16)  exit
  59.  
  60.  
  61. ==============
  62. value type declared inconsistently
  63.     exit       llib-lc(235) :: a.c(16)
  64. function argument ( number ) used inconsistently
  65.     fread( arg 1 )       llib-lc(170) :: a.c(11)
  66. function returns value which is always ignored
  67.     fclose        printf    
  68. mixed old-style/new-style function declaration
  69.     exit       llib-lc(235) :: a.c(16)
  70.  
  71. You could have saved much time, even though I cannot explain why the program
  72. is running without -O. It must not run!
  73. Just my $0.02 worth...
  74.  
  75.     Lutz
  76. -- 
  77. Lutz Jaenicke                 jaenicke@emserver.ee.tu-berlin.de 
  78. Institut fuer Elektrische Maschinen    jaenicke@emapollo.ee.tu-berlin.de
  79. Technische Universitaet Berlin        Tel. (004930)314-24552
  80. Einsteinufer 11, D-1000 Berlin 10     Fax. (004930)314-21133 
  81.