[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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

Dne 25.10.2010 12:44, ejt 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 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.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]