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 16:09:30 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2

On 05/02/2016 03:17 PM, Rik wrote:
On 05/02/2016 12:40 PM, Daniel J Sebald wrote:
On 05/02/2016 02:26 PM, Rik wrote:
On 05/02/2016 11:28 AM, address@hidden wrote:
Subject:
Bad-sounding schur.cc compilation warnings.
From:
Daniel J Sebald <address@hidden>
Date:
05/02/2016 10:59 AM

To:
Maintainers List Octave <address@hidden>

List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
7bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
3


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;
                    ^
/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 = FloatMatrix; octave_idx_type = int;
std::string = std::basic_string<char>]':
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:265:18:
warning: variable 'selector' might be clobbered by 'longjmp' or
'vfork' [-Wclobbered]
    float_selector selector = 0;
                   ^
/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 = ComplexMatrix; octave_idx_type = int;
std::string = std::basic_string<char>]':
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:354:20:
warning: variable 'selector' might be clobbered by 'longjmp' or
'vfork' [-Wclobbered]
    complex_selector selector = 0;
                     ^
/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 = FloatComplexMatrix; octave_idx_type = int;
std::string = std::basic_string<char>]':
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:463:26:
warning: variable 'selector' might be clobbered by 'longjmp' or
'vfork' [-Wclobbered]
    float_complex_selector selector = 0;

Dan

The warnings are ugly, but they aren't hazardous to Octave.  The wrapper
around Fortran function calls can potentially use longjmp to recover
from errors which is why you're getting the message.  If you look at the
actual C++ code it immediately returns after calling the Fortran
function and so any clobbered value would not get used.

Most of the time we have used the volatile keyword as part of the
variable declaration just to quiet the compiler.  There is probably a
small performance penalty for doing so, but since we've done it
everywhere else, we could also do it here.  For what it's worth, I don't
get any such nasty warning with gcc-5.2.1.

OK. I've version 4.8.4:

gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.1)

Mint/Unbuntu seems behind a bit in software versions, maybe with the
intent of being more bug stable.

Dan

Dan,

Can you try the attached cset?  It should suppress the warning message.

--Rik

I did

touch /home/sebald/octave/octave/octave/liboctave/numeric/schur.cc
make
[I see the errors]
patch -p1 < ~/octave/rik/schurv.cset
make
[I don't see the error at 176 any longer]

So, yes, prevents the warning. But there are three more instances of this error at these lines

/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:263:18: warning: variable 'selector' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
   float_selector selector = 0;
                  ^
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:352:20: warning: variable 'selector' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
   complex_selector selector = 0;
                    ^
/home/sebald/octave/octave/octave/liboctave/numeric/schur.cc:461:26: warning: variable 'selector' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
   float_complex_selector selector = 0;
                          ^

Thanks,

Dan



reply via email to

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