ruby-numo / numo-linalg

Linear Algebra Library for Ruby/Numo::NArray
BSD 3-Clause "New" or "Revised" License
38 stars 9 forks source link

Fix to use conditional expressions on ger and syr2k methods #44

Closed yoshoku closed 1 year ago

yoshoku commented 2 years ago

When building numo-linalg, the apple clang compiler v13.1.6 displays parentheses warnings:

ext/numo/linalg/blas/gen/../tmpl/ger.c:108:18: warning: using the result of an assignment as a c
ondition without parentheses [-Wparentheses]
    if (ndf.nout = 1) { // a is not given.
        ~~~~~~~~~^~~

...

ext/numo/linalg/blas/gen/../tmpl/syr2k.c:127:18: warning: using the result of an assignment as a
 condition without parentheses [-Wparentheses]
    if (ndf.nout = 1) { // c is not given.
        ~~~~~~~~~^~~

I think that a conditional expression is more appropriate than an assignment expression and have fixed it as such.

yoshoku commented 1 year ago

Thank you for your consideration.