Skip to content

std.cfg: added EXIT_SUCCESS and EXIT_FAILURE#6223

Merged
orbitcowboy merged 1 commit intocppcheck-opensource:mainfrom
firewave:std-exit
Apr 3, 2024
Merged

std.cfg: added EXIT_SUCCESS and EXIT_FAILURE#6223
orbitcowboy merged 1 commit intocppcheck-opensource:mainfrom
firewave:std-exit

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Apr 3, 2024

Although the values are implementation dependent and thus not documented, they reflect the common values of 0 and positive non-0 for success/failure. For the analysis it is also not important that these are correct but that they are being consistent across the code.

https://en.cppreference.com/w/cpp/utility/program/EXIT_status

Although the values are implementation dependent and thus not documented, they reflect the common values of 0 and positive non-0 for success/failure. For the analysis it is also not important that these are correct but that they are being consistent across the code.

https://en.cppreference.com/w/cpp/utility/program/EXIT_status
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Apr 3, 2024

This is used in our own code:

cli/cppcheckexecutor.cpp:191:16: debug: valueFlowConditionExpressions bailout: Skipping function due to incomplete variable EXIT_FAILURE [valueFlowBailoutIncompleteVar]
        return EXIT_FAILURE;
               ^

And are top results in daca:

3507 EXIT_FAILURE
[...]
1975 EXIT_SUCCESS

@orbitcowboy orbitcowboy merged commit f94a60d into cppcheck-opensource:main Apr 3, 2024
@firewave firewave deleted the std-exit branch April 3, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants