home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.hp
- Path: sparky!uunet!mcsun!Germany.EU.net!math.fu-berlin.de!zrz.tu-berlin.de!jaenicke
- From: jaenicke@emserver.ee.tu-berlin.de (Lutz Jaenicke)
- Subject: Re: that HPUX cc compiler
- Message-ID: <P7O63VN@mailgzrz.tu-berlin.de>
- Sender: news@mailgzrz.tu-berlin.de (News Manager)
- Nntp-Posting-Host: emws1.ee.tu-berlin.de
- Organization: TU-Berlin, Institut fuer Elektrische Maschinen
- References: <1992Aug31.104950.1108@bohra.cpg.oz.au> <4722@prcrs.prc.com>
- Date: Fri, 4 Sep 1992 12:59:53 GMT
- Lines: 68
-
- In article <4722@prcrs.prc.com> paul@prcrs.prc.com (Paul Hite) writes:
- >--------------
- >#include <stdio.h>
- >#include <sys/stat.h>
- >#include <utmp.h>
- >#include <time.h>
- >time_t bogus;
- >main ()
- >{
- > FILE *u;
- > struct utmp entry;
- > u = fopen("/etc/utmp","r");
- > while(fread(entry, sizeof entry, 1, u)) {
- > bogus = entry.ut_time;
- > printf("bogus = %d\n");
- > }
- > fclose(u);
- > exit(0);
- >}
-
- # cc -Aa -D_HPUX_SOURCE paul.c
- cc: "a.c", line 11: error 1718: Types are not assignment-compatible.
- cc: "a.c", line 11: warning 563: Argument #1 is not the correct type.
- # lint paul.c
-
- a.c
- ==============
- (17) warning: 'main' returns random value to invocation environment
-
-
- ==============
- value type declared inconsistently
- exit llib-lc(235) :: a.c(16)
- function argument ( number ) used inconsistently
- fread( arg 1 ) llib-lc(170) :: a.c(11)
- function returns value which is always ignored
- fclose printf
- # lint -Aa -D_HPUX_SOURCE paul.c
-
- a.c
- ==============
- (11) types in call and definition of 'fread' are incompatible for parameter
- '#1'
- (17) warning: 'main' returns random value to invocation environment
- warning: function prototype not visible at point of call:
- (16) exit
-
-
- ==============
- value type declared inconsistently
- exit llib-lc(235) :: a.c(16)
- function argument ( number ) used inconsistently
- fread( arg 1 ) llib-lc(170) :: a.c(11)
- function returns value which is always ignored
- fclose printf
- mixed old-style/new-style function declaration
- exit llib-lc(235) :: a.c(16)
-
- You could have saved much time, even though I cannot explain why the program
- is running without -O. It must not run!
- Just my $0.02 worth...
-
- Lutz
- --
- Lutz Jaenicke jaenicke@emserver.ee.tu-berlin.de
- Institut fuer Elektrische Maschinen jaenicke@emapollo.ee.tu-berlin.de
- Technische Universitaet Berlin Tel. (004930)314-24552
- Einsteinufer 11, D-1000 Berlin 10 Fax. (004930)314-21133
-