[Ns-bugs] [Bug 150] CommandLine::Parse argc parameter should not be a reference

bugzilla-daemon@nsnam-www.ece.gatech.edu bugzilla-daemon at nsnam-www.ece.gatech.edu
Sat Mar 22 10:58:39 PDT 2008


http://www.nsnam.org/bugzilla/show_bug.cgi?id=150





------- Comment #1 from mathieu.lacage at sophia.inria.fr  2008-03-22 13:58 -------
(In reply to comment #0)
> Something I found out while working on python bindings:
> 
>   /**
>    * \param argc the 'argc' variable: number of arguments (including the
>    *        main program name as first element).
>    * \param argv the 'argv' variable: a null-terminated array of strings,
>    *        each of which identifies a command-line argument.
>    * 
>    * Obviously, this method will parse the input command-line arguments and
>    * will attempt to handle them all.
>    */
>   void Parse (int &argc, char *argv[]) const;
> 
> This is wrong; the only explanation for argc being a reference would be that it
> is inout or out argument.  However, when I looked at the sources I was
> surprised to discover that it was neither.  In this case the & is misleading
> and unnecessary.
> 

You are right.


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Ns-bugs mailing list