casts to (void)

M.J.Shannon mjs at eagle.UUCP
Mon Aug 5 22:54:43 AEST 1985


> In article <116 at rtp47.UUCP> meissner at rtp47.UUCP (Michael Meissner) writes:
> >
> >Whenever I use things like printf with lint, I define things like:
> >
> >	#define	Printf	(void) printf
> >	#define	Fputs	(void) fputs
> >
> >		/* ... */
> >
> >	Printf("Hello World!\n");
> >
> >Which translates to:
> >
> >	(void) printf("Hello World!\n");
> >
> >Thus lint is kept happy, and my program is not cluttered up with casts to void.
> 
> 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".
> 
> 						Regards
> 						Kim Chr. Madsen
> 					a.k.a.	kimcm at diku.uucp

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.
-- 
	Marty Shannon
UUCP:	ihnp4!eagle!mjs
Phone:	+1 201 522 6063

Warped people are throwbacks from the days of the United Federation of Planets.



More information about the Comp.lang.c mailing list