[PATCH] Selftest improvements
jamiemcclymont at catalyst.net.nz
Thu Feb 8 04:01:07 UTC 2018
On 08/02/18 16:17, jim via samba-technical wrote:
> Why do you remove the explicit argument declarations for so many
> These declarations help catch usage errors, i.e. wrong number of calling
> arguments, especially when you add arguments to functions.
My understanding is that because these are object methods, the
prototypes actually were not providing the checking benefits [see
PERLSUB(1) (section "Prototypes")] -- this is evidenced by the fact that
some of the prototypes I removed actually had the wrong number of arguments!
Now that the subroutines are being dynamically called by function
references, the checking also appears not to apply [see the same source].
There was also a more concrete reason: the setup code will automatically
set up multiple environment dependencies and pass each of their vars as
an individual parameter. Accomplishing this was [seemingly] impossible
with the prototypes in place.
Additionally, there seems to be a consensus among perl devs that
prototypes are generally harmful: see this post (by my colleague) for
If this is okay, attached is a version of the patch with this commit
separated out and the explanation in the message.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 26919 bytes
Desc: not available
More information about the samba-technical