Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/5/84; site mordor.UUCP
Path: utzoo!linus!philabs!cmcl2!seismo!lll-crg!mordor!jdb
From: jdb@mordor.UUCP (John Bruner)
Newsgroups: net.lang.c,net.unix-wizards
Subject: Re: casts to (void)
Message-ID: <2987@mordor.UUCP>
Date: Wed, 7-Aug-85 23:50:55 EDT
Article-I.D.: mordor.2987
Posted: Wed Aug  7 23:50:55 1985
Date-Received: Sun, 11-Aug-85 04:17:14 EDT
References: <11@brl-tgr.ARPA> <1288@eagle.UUCP> <15908@watmath.UUCP> <116@rtp47.UUCP> <1096@diku.UUCP> <1310@eagle.UUCP>
Organization: S-1 Project, LLNL
Lines: 25
Xref: linus net.lang.c:5414 net.unix-wizards:11444

> > That's a mediocre solution, it shouldn't be necessary lint should know the
> > set of standard functions which results needn't be used. It's not accept-
> > able to either put (void) in front of printf(), scanf(), ...etc. or make
> > defines like "#define Printf (void) printf".
> 
> And programs that do this don't recover from write errors, like when a
> filesystem runs out of space.  That's what lint *correctly* complains about.

For instance, the "passwd" program, which, when copying "passwd"
to "ptmp", will blissfully truncate the password file if the root
filesystem is out of space.  This problem has been around since (at
least) V6 and STILL isn't fixed in either 4.2BSD or System V.  (The
4.2BSD "passwd" program doesn't bother to cast fprintf(), which the
manual page doesn't document as returning a value anyway.  In System V,
"passwd" calls putpwent(), which does check for an error and returns
an error indication.  Unfortunately, "passwd" doesn't bother to check
(or cast to (void)) the return value from putpwent().)
--
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  MILNET: jdb@mordor [jdb@s1-c.ARPA]	(415) 422-0758
  UUCP: ...!ucbvax!dual!mordor!jdb 	...!seismo!mordor!jdb
-- 
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  MILNET: jdb@mordor [jdb@s1-c.ARPA]	(415) 422-0758
  UUCP: ...!ucbvax!dual!mordor!jdb 	...!seismo!mordor!jdb