svn commit: samba r6127 - in branches/SAMBA_3_0/source: include lib libads libsmb nsswitch rpc_server tdb utils

Gerald (Jerry) Carter jerry at samba.org
Wed Mar 30 22:31:59 GMT 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

derrell at samba.org wrote:

| This is actually a gripe that I wanted to discuss.  Although
| I put a band-aid on it, you're right, my casts don't solve
| the problem.  If "const" isn't going to be used properly, or
| more accurately, consistently, it really shouldn't be
| used at all.  Passing a "char *" to a function that
| expects a "const char *" which in turn passes it to a function
| that expects a "char *" just seems screwy.  Is it const or isn't
| it?  Fooling the compiler should not be necessary.

I agree here. I argued this same point when the const religion
got started.  const in C is a joke IMO.  The compiler
doesn't really mark the memory as read-only so you just as well
off to put the const keyword in the comments for the function
formal declaration.  Then at least you don't get the silly
warnings about something you know you already did.

But I digress....

| This is a bit of a hot-button for me, because I have
| seen, way too often, programmers have bugs whose cause
| immediately became obvious after compiling with -Wall, or
| in some even worse cases, -Wall was on, the warnings were
| blaring out at them from their screen, and they
| continually ignored them.  Sigh.

I can pretty much guarantee that every active developer
uses the compiler warnings.

Stuff like this in tdbutil.c may shut the compiler up some
but doesn't change reality of what's going on:

	tdb_set_lock_alarm((sig_atomic_t *) &gotalarm);





cheers, jerry
=====================================================================
Alleviating the pain of Windows(tm)      ------- http://www.samba.org
GnuPG Key                ----- http://www.plainjoe.org/gpg_public.asc
"I never saved anything for the swim back."     Ethan Hawk in Gattaca
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCSyjfIR7qMdg1EfYRAqXqAJ0ZdhlkNt9xrE/n8YhBw4GInxT3YgCg4Aug
Z0ejmHBAtKmlUfiE7MoKs5E=
=okjA
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list