-
Notifications
You must be signed in to change notification settings - Fork 54
Open
Description
https://github.com/eblot/newlib/blob/master/newlib/libc/string/strtok_r.c#L44 is being flagged by Sonarqube with these references
MISRA C:2004, 12.4 - The right-hand operand of a logical && or || operator shall not contain side effects.
MISRA C++:2008, 5-14-1 - The right hand operand of a logical && or || operator shall not contain side effects.
MISRA C:2012, 13.5 - The right hand operand of a logical && or || operator shall not contain persistent side effects
CERT, EXP02-C. - Be aware of the short-circuit behavior of the logical AND and OR operators
I see their point - the right hand side of the expression may or may not be run
if (s == NULL && (s = *lasts) == NULL)
Metadata
Metadata
Assignees
Labels
No labels