mount.cifs - "Const" warnings patch

Jeff Layton jlayton at
Wed Nov 11 12:11:32 MST 2009

On Sat, 7 Nov 2009 15:45:45 +0000 (GMT)
Matthias Dieter Wallnöfer <mdw at> wrote:

> Hi Jeff!
> Yeah, please apply! My mission of this patch(set) was to prevent "CONST" warnings. Your solution does it in a very elegant manner (I would have only introduced another discard-const macro - which is far from perfect). Therefore it should be perfectly okay!
> Thanks for working with me on the CONST issue.
> Matthias
> --- Jeff Layton <jlayton at> schrieb am Sa, 7.11.2009:
> Von: Jeff Layton <jlayton at>
> Betreff: Re: mount.cifs - "Const" warnings patch
> An: "Matthias Dieter Wallnöfer" <mdw at>
> CC: "Samba Technical Mailinglist" <samba-technical at>
> Datum: Samstag, 7. November 2009, 14:19
> On Mon, 02 Nov 2009 21:36:19 +0100
> Matthias Dieter Wallnöfer <mdw at> wrote:
> > Hi Jeff,
> > 
> > sorry, sorry - sometimes I forget the attachments.
> > 
> > Now it should be okay.
> > 
> No problem, I do the same thing sometimes.
> The patch looks safe enough, but I wonder whether the problem is really
> in addmntent. Looking at a recent glibc, it doesn't look like addmntent
> ever changes any of the strings it gets passed. If any of them need to
> be reencoded, it uses alloca to get a new buffer and reencodes the
> string into that. Maybe the prototype for it should declare the struct
> as const.
> Fixing it there though may be problematic. Assuming that not stripping
> off the const generates a warning, maybe it would be a little more
> clear to just declare a non-const variable to hold a "cifs" string and
> pass that in instead. Something like this maybe?

Pushed to master.

Matthias, do you think this needs to go to any other branches?

Jeff Layton <jlayton at>

More information about the samba-technical mailing list