Newsgroups: news.software.b
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!stealth
From: stealth@caen.engin.umich.edu (Mike Pelletier)
Subject: Re: Problem compiling latest C-news under Ultrix 4.1
Message-ID: <1991Apr4.150426.25479@engin.umich.edu>
Sender: news@engin.umich.edu (CAEN Netnews)
Organization: University of Michigan Engineering, Ann Arbor
References: <1991Apr3.173459.3081@engin.umich.edu> <1991Apr3.190011.1117@zoo.toronto.edu> <1991Apr4.035820.8952@watmath.waterloo.edu>
Date: Thu, 4 Apr 1991 15:04:26 GMT

In article <1991Apr4.035820.8952@watmath.waterloo.edu>
	gamiddle@watmath.waterloo.edu (Guy Middleton) writes:
>In article <1991Apr3.190011.1117@zoo.toronto.edu>
	henry@zoo.toronto.edu (Henry Spencer) writes:
>> In article <1991Apr3.173459.3081@engin.umich.edu> I write:
>> >      char *ptr;
>> >      ---^
>> >ccom: Error: rdwr.c, line 70: redeclaration of fwrite
>> 
>> You can try changing those "char *"s to "void *"s, although this will mean
>> further work within the routines to make it all turn out right.  Not a
>> trivial fix, I'm afraid.
>
>Actually, the fix is to change
>
>	int
>	fread(ptr, size, count, fp)
>
>to	size_t
>	fread(ptr, size, count, fp)
>
>Changing "char *" to "void *" fixes the warnings, but not the errors.

Thanks, Guy, that worked perfectly!
I still get two warnings out of that file, namely:

ccom: Warning: rdwr.c, line 44: illegal pointer combination
                                fp->_ptr = (unsigned char *)bp;
      --------------------------------------------------------^
ccom: Warning: rdwr.c, line 93: illegal pointer combination
                                fp->_ptr = (unsigned char *)bp;
      --------------------------------------------------------^

but it does indeed produce a .o file in spite of these complaints.
Why does changing "int" to "size_t" cure this particular problem?
Isn't size_t just typedef'ed to int in one of the include files?

--
Mike Pelletier                     |
The University of Michigan's       |           [this section intentionally]
Computer Aided Engineering Network |           [         left blank       ]
  Usenet, UUCP, IRC and mail admin |
