Skip to content

add missing return types to main() #85

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

Merged
merged 1 commit into from
Dec 26, 2019
Merged

add missing return types to main() #85

merged 1 commit into from
Dec 26, 2019

Conversation

DerDakon
Copy link
Member

No description provided.

@alanpost
Copy link
Contributor

A similar treatment (adding explicit void to main) should be given to the following files:

trylsock.c
tryrsolv.c
trysyslog.c

@DerDakon
Copy link
Member Author

good catch, no idea why I did not spot them.

@alanpost alanpost added this to the 1.08 milestone Aug 25, 2019
@DerDakon DerDakon force-pushed the missing-main-return branch from d4511a8 to 92f7884 Compare August 25, 2019 18:34
@DerDakon DerDakon force-pushed the missing-main-return branch from 92f7884 to 9ff954f Compare August 31, 2019 06:19
@DerDakon DerDakon requested a review from alanpost September 3, 2019 16:12
@DerDakon DerDakon force-pushed the missing-main-return branch from 9ff954f to 65ab0e3 Compare September 3, 2019 16:13
@DerDakon
Copy link
Member Author

DerDakon commented Sep 3, 2019

The point is: main() is void everywhere, because it does not return and the return code comes from _exit(). I avoid _exit() here to not drag in more headers for no reasons, and just make it int main() and return 0;.

@alanpost
Copy link
Contributor

alanpost commented Sep 3, 2019

The point is: main() is void everywhere, because it does not return and the return code comes from _exit(). I avoid _exit() here to not drag in more headers for no reasons, and just make it int main() and return 0;.

Nowhere in the codebase does it return from main. Everywhere it calls _exit. We should preserve that behavior.

@DerDakon DerDakon force-pushed the missing-main-return branch from 65ab0e3 to 62afa31 Compare September 3, 2019 21:17
@DerDakon DerDakon requested a review from schmonz September 4, 2019 15:17
@DerDakon
Copy link
Member Author

DerDakon commented Sep 9, 2019

Btw, Clang now issues these warnings:

qmail-qmqpc.c:138:1: warning: return type of 'main' is not 'int'

@DerDakon DerDakon force-pushed the missing-main-return branch from 62afa31 to 0d36c26 Compare November 3, 2019 09:39
@DerDakon
Copy link
Member Author

DerDakon commented Nov 3, 2019

I'm back to "int main()" now. Fixing one warning with another does not help, and the consistency doesn't give us anything, especially as it's only about try*.c where noone needs to look on any bigger API or structure.

@DerDakon DerDakon modified the milestones: 1.09, 1.08 Nov 18, 2019
Copy link
Member

@schmonz schmonz left a comment

Choose a reason for hiding this comment

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

Consider adding a CHANGES entry. (Good time to refresh ourselves on our criteria for pull requests.)

@DerDakon DerDakon force-pushed the missing-main-return branch from 0d36c26 to cd8193f Compare December 26, 2019 21:37
@DerDakon DerDakon merged commit cd8193f into master Dec 26, 2019
@DerDakon DerDakon deleted the missing-main-return branch December 26, 2019 21:54
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.

4 participants