Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples: swap magic numbers for EXIT_ codes #1618

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Cheapshot003
Copy link
Contributor

As discussed in #1609 this PR will use EXIT_{success, failure} codes instead of magic numbers in the return statements.

If it looks good I will continue to remove the asserts too in another commit.

@real-or-random
Copy link
Contributor

If it looks good I will continue to remove the asserts too in another commit.

It looks good in principle. But your PR already needs to be rebased now. (Did you accidentally build on an outdated version of master?)

@real-or-random real-or-random changed the title Examples: swap magic numbers for EXIT_ codes#1609-swap magic numbers for exit codes in examples Examples: swap magic numbers for EXIT_ codes Oct 15, 2024
Comment on lines -73 to +74
return 0;
return EXIT_FAILURE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that the EXIT_... constants are only meant to be used for program termination (i.e. to be returned from main, or as argument to exit(...)), not as return codes in our own functions (in this case tweak(...))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor/smell user-documentation user-facing documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants