Files
OpenShadingLanguage/testsuite/oslc-warn-commainit/ref/out.txt
T
Larry Gritz d132ce65d9 Warn for common misstep of forgetting constructor name. (635)
shader test ( output color Cout = 0 )
    {
        vector x = (1, 2, 3);
    }

See where this goes wrong? This code will make x be (3,3,3).  If you
don't know why, think about how the comma operator works in C, C++, and
related languages.

The user almost certainly meant

    vector x = vector (1, 2, 3);

With this change, the original (buggy) code will get the following
warning output:

    test.osl:3: warning: Comma operator is very confusing here. Did you mean to use a constructor: x = vector(...)?
2016-04-05 16:23:47 -07:00

4 lines
251 B
Plaintext

test.osl:3: warning: Comma operator is very confusing here. Did you mean to use a constructor: x = vector(...)?
test.osl:4: warning: Comma operator is very confusing here. Did you mean to use a constructor: = color(...)?
Compiled test.osl -> test.oso