octave-maintainers
[Top][All Lists]
Advanced

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

Re: Bad-sounding schur.cc compilation warnings.


From: Daniel J Sebald
Subject: Re: Bad-sounding schur.cc compilation warnings.
Date: Mon, 2 May 2016 13:38:17 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 05/02/2016 12:59 PM, Daniel J Sebald wrote:
I saw the following warnings during compilation.  They look kind of
troublesome:

/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc: In member
function 'octave_idx_type schur<T>::init(const T&, const string&, bool)
[with T = Matrix; octave_idx_type = int; std::string =
std::basic_string<char>]':
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:176:19:
warning: variable 'selector' might be clobbered by 'longjmp' or 'vfork'
[-Wclobbered]
    double_selector selector = 0;

Hmm, very strange construct.  double_selector is a function type:

typedef octave_idx_type (*double_selector) (const double&, const double&);

so I can see why the complaint pertains to long-jumping and forking. I don't quite understand the issue though. The intention is to select the function that will be run for selecting:

  double_selector selector = 0;
  if (ord_char == 'A' || ord_char == 'a')
    selector = select_ana<double>;
  else if (ord_char == 'D' || ord_char == 'd')
    selector = select_dig<double>;
  else
    selector = 0;

(Note that the "double_selector selector = 0;" and third case "selector = 0" is redundant.) The prototype has two input variables, but the template assigned to it has just <double>, but that doesn't seem like a program flow issue. Does the type-definition for the (*double_selector) need a "long" specification somehow?

Dan



reply via email to

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