Repository navigation
Add check for ternary without a second operand - #4677
chrchr-github wants to merge 6 commits into
Conversation
This reverts commit 28df0f0.
danmar
left a comment
There was a problem hiding this comment.
I don't see any real danger. It's not like it will behave differently.
|
Such an operator could also be created by mistake, and it's arguably harder to read. The check was actually @orbitcowboy's idea. |
Yes, thanks for implementing it! I still think it is worth to warn for compiler specific syntax like this. |
|
In addition: Portability is the right section for this. If some project wants to have potable code, this warning is issued. |
|
There are of course numerous extensions that we could warn about: https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html |
|
If another compiler is used you can't compile the code. That is not dangerous. If we want to have warnings about compiler extensions I am thinking that it can be put in a addon. I think that our portability warnings in cppcheck should typically indicate that the code might behave different on different platforms. like implementation defined behavior etc. |
No description provided.