octave-maintainers
[Top][All Lists]
Advanced

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

Warning while compiling Octave with clang


From: PrasannaKumar Muralidharan
Subject: Warning while compiling Octave with clang
Date: Thu, 6 Mar 2014 21:08:42 +0530

Hi,

I was compiling octave with clang. Found some warning. I am planning
to bring them to octave maintainers notice one by one. Please have a
look at it.

Compiled hg changeset "18532:87dfe4892ef9".

array/CMatrix.cc:1794:16: warning: variable 'rcon' is used
uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
      else if (typ == MatrixType::Permuted_Lower)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
array/CMatrix.cc:1884:10: note: uninitialized use occurs here
  return rcon;
         ^~~~
array/CMatrix.cc:1794:12: note: remove the 'if' if its condition is always false
      else if (typ == MatrixType::Permuted_Lower)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
array/CMatrix.cc:1766:17: warning: variable 'rcon' is used
uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
      else if  (typ == MatrixType::Permuted_Upper)
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
array/CMatrix.cc:1884:10: note: uninitialized use occurs here
  return rcon;
         ^~~~
array/CMatrix.cc:1766:12: note: remove the 'if' if its condition is always false
      else if  (typ == MatrixType::Permuted_Upper)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
array/CMatrix.cc:1729:7: warning: variable 'rcon' is used
uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
  if (nr != nc)
      ^~~~~~~~
array/CMatrix.cc:1884:10: note: uninitialized use occurs here
  return rcon;
         ^~~~
array/CMatrix.cc:1729:3: note: remove the 'if' if its condition is always false
  if (nr != nc)
  ^~~~~~~~~~~~~
array/CMatrix.cc:1725:14: note: initialize the variable 'rcon' to
silence this warning
  double rcon;
             ^
              = 0.0
3 warnings generated.


In line 1795 current_liboctave_error_handler is called. In this case
rcon is not initialised and return rcon at line 1884 looks like a
problem. I guess that function call will stop interpreting / executing
the current command. Is this correct? If that is the case there is no
issues. Please clarify.

Thanks and Regards,
PrasannaKumar


reply via email to

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