Re: [PATCH 00/16] git-send-email cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 30, 2010 at 10:30:31AM -0400, Brian Gernhardt wrote:

> >  send-email: get_patch_subject doesn't need a prototype
> >  send-email: file_declares_8bit_cte doesn't need a prototype
> >  send-email: unique_email_list doesn't need a prototype
> >  send-email: cleanup_compose_files doesn't need a prototype
> 
> None of these subroutines strictly need the prototype, but it does
> allow Perl to warn us if we send incorrect arguments.  Why remove
> them?  Are they causing problems somewhere?

They don't necessarily do what you want:

  perl -e 'sub want_scalar($) { print "got $_[0]\n" }
           want_scalar("ok");
           my @a = qw(totally broken);
           want_scalar(@a);
  '

I get:

  got ok
  got 2

And using "sub want_list(@)" basically does nothing at all (you can pass
nothing, a scalar, or a list).

For more details, read:

 http://www.perlmonks.org/?node_id=861966

(If you're impatient, skip to the section "Problems with Regular
Prototypes").

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]