You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be with braces not parenthesis like the following,
float vColor = { 0.f, 0.f, 0.f, 1.f };
When the parenthesis is used, it is not entirely incorrect from the syntax perspective.
The expression ( 0.f, 0.f, 0.f, 1.f ) is treated as four expressions connected with comma-operators.
And the last expression, which is 1.f in this case, is used as a value to float vColor.
Although it is a mistake on the user side, it will be nice to print a warning to inform the possible mistake.
Possible solution
A suggested solution from Yong is to allow comma-operators only in for-loop.
And when comma-operators are used elsewhere, we should print a warning that the user can also suppress if needed.