LDB hidden memory leaks

Kamen Mazdrashki kamenim at gmail.com
Sun Jul 11 12:32:17 MDT 2010


On Sat, Jul 10, 2010 at 17:00, Kamen Mazdrashki <kamenim at gmail.com> wrote:

> On Sat, Jul 10, 2010 at 11:16, Stefan (metze) Metzmacher <metze at samba.org>wrote:
>
>>
>>
>
>
> The way you added this:
>>
>> +#ifndef _DEPRECATED_
>> +#define _DEPRECATED_   __attribute__ ((deprecated))
>> +#endif
>>
>> is not portable, not every compiler supports this.
>>
>> The correct definition already comes from replace.h.
>> So ldb.h only needs this:
>>
>> +#ifndef _DEPRECATED_
>> +#define _DEPRECATED_
>> +#endif
>>
>
> You are right but... this is not what my intention is.
> I am pretty sure I've caught all places in Samba4 where _deprecated_
> functions are used. In your way we will receive warning only when compiling
> Samba.
> I wanted this for the users of LDB (not just Samba).
> So, how to achieve this?
> (I thought I did it the same way as with PRINTF_ATTRIBUTE macro, but now
>  I see I am not)
>
> Perhaps pasting the whole snippet from replace.h like this?
>
> #ifndef _DEPRECATED_
> #if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
> #define _DEPRECATED_ __attribute__ ((deprecated))
> #else
> #define _DEPRECATED_
> #endif
> #endif
>
>
After Metze's comment I've updated the last commit:
http://gitweb.samba.org/?p=kamenim/samba.git;a=shortlog;h=refs/heads/ldb-mem-fix

As I want to warn not only in Samba's source base that those functions are
deprecated,
I've copy&paste the whole snippet for _DEPRECATED_ from replace.h

Any comments?

-- 
CU,
Kamen


More information about the samba-technical mailing list