[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 mdw at samba.org
Mon Sep 28 07:25:20 MDT 2009

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 
- 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:


More information about the samba-technical mailing list