[test.cpp:4]: (portability) Returning an integer (int/long/etc) in a function with pointer return type is not portable across different platforms and compilers.
The problem is, CppCheck tracks only the type of auto but not the complete type auto *
Last edit: Toni Neubert 2020-07-06
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We are using CppCheck 1.9 at the moment. I double checked the issue with the online demo (http://cppcheck.sourceforge.net/demo/) but this seems to use also an older version.
Last edit: Toni Neubert 2020-07-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following code creates a false-positive:
The problem is, CppCheck tracks only the type of auto but not the complete type auto *
Last edit: Toni Neubert 2020-07-06
I fail to reproduce with the latest cppcheck.
Well it says that
i
has typesigned int *
as far as I see. Not sure maybe you have an old Cppcheck version that did not track this properly.Ah, I see, thank you.
We are using CppCheck 1.9 at the moment. I double checked the issue with the online demo (http://cppcheck.sourceforge.net/demo/) but this seems to use also an older version.
Last edit: Toni Neubert 2020-07-08