LDB hidden memory leaks

Kamen Mazdrashki kamenim at gmail.com
Sat Jul 10 08:00:46 MDT 2010


Hey Metze,

Thanks for your review!

On Sat, Jul 10, 2010 at 11:16, Stefan (metze) Metzmacher <metze at samba.org>wrote:

> Regarding the reformating:
> I'd like to push this patch
>
> http://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=464ea4c0ac1318287bcf3985efeae34c3ed8b521
> which explains good and bad comment example.
>
> It would be nice if you could push this for me, if nobody complains.
> The reformat in the explained style.
>

It is great we will have a common policy for comments!
(and Eclipse already does comments in the style you described, great for me
;)


>

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



>
> I'm wondering if ldb_msg_canonicalize[_ex] should take care of the
> element type,
> only elements  of the same type should be combined. (But that can be an
> additional patch)
>

I guess "same type" elements means elements with same (name, flags) right?
I think you are totally right and it will be nice to have this implemented.
Can we discuss this on IRC?

-- 
CU,
Kamen


More information about the samba-technical mailing list