From bug-octave-request at bevo dot che dot wisc dot edu Sat Feb 3 18:41:58 2001 Subject: more parser bugs? From: "John W. Eaton" To: Etienne Grossmann Cc: bug-octave at bevo dot che dot wisc dot edu Date: Sat, 3 Feb 2001 18:41:18 -0600 On 3-Feb-2001, Etienne Grossmann wrote: | To: bug-octave at bevo dot che dot wisc dot edu | Cc: etienne | Subject: more parser bugs? | | Bug report for Octave 2.1.33 configured for %OCTAVE_CANONICAL_HOST_TYPE% | | Description: | ----------- | | Hello, | | with 2.1.33, I get a lot of warning like this | | ====================================================================== | octave:1> test_connect | warning: suggest parenthesis around assignment used as truth value | warning: near line 19, column 8: | | >>> ## 1 | >>> [l, ii] = connect ([1], [2], [2, 7, 5], [1, 3], [4, 6, 8, 2]); I think it is this line if (jj(i) = ! isempty (intersection (nth(l,i), tmp))), in connect.m that is generating the warning. I agree that the warning message is not displaying the correct line and file information, but it is correct that there is an assignment inside an if statement that you might be concerned about. To avoid the warning, you need to write if ((jj(i) = ! isempty (intersection (nth(l,i), tmp)))) The first set of parenthesis is ignored for the purposes of the warning because the are expected to be there in any case. If it were completely up to me (i.e., not Matlab compatibility concerns) then they would not be optional. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------