Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jh4o+ From: jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) Newsgroups: comp.lang.c Subject: Re: Return value ignored warning from lint [was: Why use (void) func()] Message-ID: Date: 30 Sep 90 03:42:11 GMT References: <586@dptechno.UUCP> <1990Sep24.193012.14074@diku.dk> <12141@crdgw1.crd.ge.com>, <4068@sactoh0.SAC.CA.US> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 17 In-Reply-To: <4068@sactoh0.SAC.CA.US> jak@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+@andrew.cmu.edu, jhutz@drycas.club.cc.cmu.edu >> Apple // Forever!!! <<