octave-maintainers
[Top][All Lists]
Advanced

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

GCC warning for qr.cc


From: John W. Eaton
Subject: GCC warning for qr.cc
Date: Wed, 18 Feb 2009 02:44:40 -0500

I'm seeing the following warning from gcc:

  src/DLD-FUNCTIONS/qr.cc:745: warning: suggest parentheses around && within ||

The code is:

  740 static
  741 bool check_qr_dims (const octave_value& q, const octave_value& r,
  742                     bool allow_ecf = false)
  743 {
  744   octave_idx_type m = q.rows (), k = r.rows (), n = r.columns ();
  745   return ((q.ndims () == 2 || r.ndims () == 2 && k == q.columns ())
  746             && (m == k || (allow_ecf && k == n && k < m)));
  747 }

Is this check correct?  Shouldn't Q and R both always be required to
have 2 dimensions?

In any case, I'd like to minimize possible confusion by adding some
parens to make the intent clear and avoid the warning.

Thanks,

jwe


reply via email to

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