[lvm-devel] [PATCH 29/30] Add some __attribute__ instrumentation

Zdenek Kabelac zkabelac at redhat.com
Mon Oct 25 11:40:03 UTC 2010


Dne 25.10.2010 12:44, ejt at redhat.com napsal(a):
> At Mon, 25 Oct 2010 10:24:36 +0200,
> Zdenek Kabelac wrote:
>>
>> Add some malloc intrumentation and warning attributes.
>>
>> Signed-off-by: Zdenek Kabelac <zkabelac at redhat.com>
> 
> Ack.  But I question how far you intend to go with this.  Surely it's more unusual to return a value that can be ignored?
> 


I think wherever it is an error to ignore returned value on public API
function, we should put some warning.  In this case it must lead to memory
leak - so it's good idea to give the user this knowledge in compile time.

(btw I'm doing nothing more then what original system headers do for you :))

What seems to have some 'hidden' fruits are those 'nonnull' __attributes__.
We have quite a few functions which take a pointer and expect it to be
non-null - so we could mark these functions and get static analysis to be done
on them.

Zdenek




More information about the lvm-devel mailing list