Question about LINT

Alan T. Bowler [SDG] atbowler at watmath.UUCP
Wed Apr 16 22:27:03 AEST 1986


In article <139200026 at uiucdcsb> robison at uiucdcsb.CS.UIUC.EDU writes:
>
>>     If one has a function which is sometimes called as a procedure
>> (ignoring returned value) is there a way to tell lint not to
>> complain about this?
>
>Cast the result to (void) when you call the function as a procedure, i.e.
>	
The problem with this is that you end up with very cluttered code
especially with routines like STRCPY whose return value is seldom
used.
    With the usual Unix LINT there is not much you can do about
this.  The Lint supplied with C on the Honeywell DPS-8 (the one
you get from Honeywell, not the Bell Labs C6000 (PCC) one),
there is a directive to LINT that you attach to the function
definition that defines it as a function with an optional result.
I.e. you only put this in 1 place, namely where you define the
code for the function.  If this is done, LINT will not complain
about ignoring the result of the particular function.



More information about the Comp.lang.c mailing list