[Prev][Next][Index]
Re: Bug during installation
- From: "Bernd W. Mohr" <mohr@cs.uoregon.edu>
- Subject: Re: Bug during installation
- To: sybok@au-bon-pain.lcs.mit.edu (Greg McLaren)
- Date: Sat, 8 Apr 1995 20:18:38 -0700 (PDT)
- Cc: sage-bugs@extreme.indiana.edu (Sage++ Bugs Mailinglist)
- In-Reply-To: <9504082312.AA25566@au-bon-pain.lcs.mit.edu> from "Greg McLaren" at Apr 8, 95 07:12:21 pm
- Sender: owner-sage-bugs@extreme.indiana.edu
> pcxx_merge.c: In function `get_next_rec':
> pcxx_merge.c:78: warning: passing arg 2 of `read' from incompatible pointer type
>
> while doing "make install" on version 1.7 of pC++. I believe the error
> is occurring because you call "read" with a pointer to a struct as its
> second argument, when in reality "read" requires a pointer to a char as its
> second argument.
>
> Is this just an oversensitivity in my compiler, or is some other version
> of "read" supposed to be present in my system that can take pointers to
> structs in lieu of pointers to chars?
No, everything is fine. "read" is supposed to take a "generic" pointer
to a buffer. In ANSI C this is "void *" and this pointer type is "compatible"
with all other pointer types. In older pre-ANSI C (for which your system's
include files are probably still written) there was no "void *" and "char *"
was used instead.
If you want to get rid of the warning insert a cast to a char pointer "(char *)"
before the 2nd argument;
Bernd
--
Bernd Mohr -- mohr@cs.uoregon.edu -- http://www.cs.uoregon.edu/~mohr
Sometimes I think the surest sign that intelligent life exists elsewhere in
the universe is that none of it has tried to contact us. -- Calvin
Reference(s):