[Ns-bugs] [Bug 150] New: 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:36:34 PDT 2008


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

           Summary: CommandLine::Parse argc parameter should not be a
                    reference
           Product: ns-3
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P3
         Component: simulation core
        AssignedTo: ns-bugs at isi.edu
        ReportedBy: gjcarneiro at gmail.com


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.


-- 
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