octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #50974] SEGFAULT with constructed cmdline_opti


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #50974] SEGFAULT with constructed cmdline_options
Date: Mon, 8 May 2017 20:07:09 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #2, bug #50974 (project octave):

My idea for cmdline_options was that it would be constructed either directly
from the argv that is passed to a program, or by creating a default
cmdline_options object and then setting the options using the member functions
like, like this:


  cmdline_options opts;
  opts.read_history_file (true);
  ...


but I can also see how it could make sense to pass your own generated argv
array to the "cmdline_options (int, char**)" constructor.  Since that is
processed with getopt, how can we ensure that it works properly other than to
expect the user to do what Mike suggests?  I don't think we can
unconditionally set optind inside the cmdline_options constructor because the
user may have already processed some options before calling the
cmdline_options constructor.

Maybe we should just document this requirement instead.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50974>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]