Return value ignored warning from lint [was: Why use (void) func()]

Jeffrey T. Hutzelman jh4o+ at andrew.cmu.edu
Sun Sep 30 13:42:11 AEST 1990


jak at sactoh0.SAC.CA.US (Jay A. Konigsberg) writes:

> fd=open("name", O_WRITE);
> fprintf(fd, "some string with or without variables");
>
> or dup() a file descriptor to stdout and use printf() to write to a
> file, then I definiatly want to know about ignoring the return value.

You can't do that.  open() and dup() generate file DESCRIPTORS -
basically ID numbers.  stdin and family and the first argument of
fprintf are file POINTERS of type FILE *.  They are 2 different things.
-----------------
Jeffrey Hutzelman
America Online: JeffreyH11
Internet/BITNET:jh4o+ at andrew.cmu.edu, jhutz at drycas.club.cc.cmu.edu

>> Apple // Forever!!! <<



More information about the Comp.lang.c mailing list