[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-4999-g07c7085
Derrell Lipman
derrell.lipman at unwireduniverse.com
Sat Feb 21 19:27:08 MST 2009
On Sat, Feb 21, 2009 at 7:28 PM, Jeremy Allison <jra at samba.org> wrote:
> On Fri, Feb 20, 2009 at 10:51:36PM -0500, Derrell Lipman wrote:
> >
> > Hmmm... Rereading... That sounds way stronger and much more aggressive
> than
> > was my intention. Sorry about that. But still, I think we can add const
> to
> > smbc_set_credentials parameters, remove all of these discards, and be
> done
> > with it, without affecting the ABI.
>
> Well that's what I'd like to do. C++ compilers encode
> the "const"ness of param types in the ABI, but C compilers
> shouldn't. Still I was being careful. If you're happy it's
> not an ABI change I'll just make smbc_set_credentials parameters
> const.
>
I couldn't locate the definitive reference, but I found lots of anecdotal
evidence that it shouldn't be an ABI change, and I ran a number of tests
with gcc, using both default optimization and -O2, and compared the
generated assembly language with and without const in the function
declaration, looking both both at the code for function itself and for the
caller of the function, and they were identical with and without the const
specifier in the function declaration. It's possible that there's a compiler
that would treat it differently, but I don't believe that it should, and I
think we're ok making the change.
Derrell
More information about the samba-technical
mailing list