[PATCH] Fix up discard-const warnings in s4 and tries to remove "discard_const_p"s/"CONST DISCARD"s in both s3 and s4

Matthias Dieter Wallnöfer mwallnoefer at yahoo.de
Tue Sep 29 04:53:52 MDT 2009

Hi all,

as suggested by abartlet, I tried to reorganize the patch in smaller 
commits (e.g. const related warnings, non-const related warnings for s4; 
const fixes without functional changes - "discard_const_p" macro, const 
fixes with functional changes for s3...). I hope I made it now easier to 
review (I know it's a very heavy patch).

Therefore I rebased it now in a different private branch here: 

If you have comments and need parts of the patch contents in form as an 
e-mail I'm happy to post them.


Matthias Dieter Wallnöfer schrieb:
> Hi all developers,
> this patch is the result of a big work:
> - for s4 it corrects a huge part of the (const) build warnings and 
> some others - but not those from heimdal kerberos
> - for s3 I removed the "CONST DISCARD" macro and substituted it with 
> "discard_const_p".
> - generally: I tried to substitute on both code bases 
> "discard_const_p"s on strings with string duplication functions (which 
> should be the right behavior to modify a const object - you have to 
> clone it first).
> I decided to split it up in the work done for s3, for s4 and for the 
> common libraries. Therefore not everyone has to watch over the whole 
> code. I'm sure that the one and the other change won't fit (since I 
> don't know much about those code parts) so I encourage you to tell me 
> this and how to make it better or simply to revert to the 
> "discard_const_p" macro (previous behavior).
> The patch as a whole shouldn't generate new warnings/bring build 
> failures.
> Since the three commits are big I don't post them here, but I give the 
> URLs in my personal repo:
> s4: 
> http://repo.or.cz/w/Samba/mdw.git?a=commitdiff;h=9593f12281209a6215835dd4357e0b16e7a760ef 
> s3: 
> http://repo.or.cz/w/Samba/mdw.git?a=commitdiff;h=4741c10cc3927094130b4bfb1b6c5bae17b22cb6 
> common: 
> http://repo.or.cz/w/Samba/mdw.git?a=commitdiff;h=f7d97cbd622e1d162b0a231050433d683286a63f 
> Matthias

More information about the samba-technical mailing list