getting rid of mkproto.sh from Samba3

Gerald (Jerry) Carter jerry at samba.org
Wed Jun 6 02:49:42 GMT 2007


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

Tridge,

You know I'm going to say this, but I respectfully disagree. :-)

I don't want to start any flame wars on style so this is
all I will say on the subject, but IMO all of your points 
imply that autogenerated headers are better because they
support bad programming habits.  Autogenerated headers are
easier for one programmer to develop but they are harder
for other programmers to use. Proto.h is a compiler workaround.
It does not make Samba development easier for anyone else.

Maybe I'm just immature and don't know any better....
But I will tackle this on my own time, in my own tree and
propose changes when and if I have working code to compare
against the SAMBA_4_0 build/proto system.  For now, this
appears to be a dead issue.

Sorry James.




cheers, jerry
=====================================================================
Samba                                    ------- http://www.samba.org
Centeris                         -----------  http://www.centeris.com
"What man is a man who does not make the world better?"      --Balian


> On 05/06/2007, at 5:10 PM, tridge at samba.org wrote:
>
>> James,
>> 
>>> If I have a decent header file, I can see the full interface in a
>>> single screen, along with comments, macros and typedefs. I don't think
>>> the argument about the extra typing involved in changing headers by
>>> hand is very strong, since the code needs to be read and understood
>>> thousands more times than it needs to be written.
>> 
>> It is not the extra typing, it's the mistakes. Before we had auto
>> prototypes in Samba the following mistakes were common:
>> 
>> *) leaving a prototype in a header for a function that has been
>>  removed. I don't know of any tool that will find/remove those.

You find it as soon as someone tries to use it.

>> *) getting details in the prototype wrong, especially the varargs
>>  functions with printf arguments.

Programmer error.

>> *) when the arguments to a function change, and the prototype isn't
>>  updated. This is especially insidious when the new and old arguments
>>  are type compatible, but change their meaning, so the old prototype
>>  is completely misleading (ie. is still takes an int as the 3rd
>>  argument, but now its a set of flags, not a counter)

programmer error.

>> *) once you start breaking up your includes out of a single
>>  includes.h, then you risk getting the prototype completely wrong if
>>  the source file of the function doesn't include the prototype
>>  header. The compiler won't complain.

programmer error.

>> *) programmers add nice comments to the prototype header, which is in
>>  a completely different file to the code. Those comments will degrade
>>  over time as the code changes and the comment is not upgraded, so
>>  those nice docs that you do this month will become completely wrong
>>  by next year, and the person updating the function will not notice,
>>  as the prototype is not on the same screen as the code they are
>>  changing.

programmer error.  And besides that, all code suffers from
this.  It is not specific to header files.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFGZiDMIR7qMdg1EfYRAmM2AJ9rAfPGNNL8pvDuozVu/LeISAWwewCghvK5
chf79MgFfxJdqIXw50yP8eE=
=bvKa
-----END PGP SIGNATURE-----


More information about the samba-technical mailing list