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

DaemonCompiler: do not omit main parameter name in C #1506

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

illwieckz
Copy link
Member

Do not omit main parameter name in C.

Fixes #1505:

This produced those errors:

../../daemon/cmake/DaemonCompiler/DaemonCompiler.c:163:13: error: parameter name omitted
int main(int, char**) {
            ^
../../daemon/cmake/DaemonCompiler/DaemonCompiler.c:163:21: error: parameter name omitted
int main(int, char**) {
                    ^
7 warnings and 2 errors generated.

Actually my first implementation of parsing the output of cc -dM -E could not be subject to that (no compilation was involved at all).

Copy link
Contributor

@VReaperV VReaperV left a comment

Choose a reason for hiding this comment

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

LGTM

@slipher
Copy link
Member

slipher commented Jan 17, 2025

Why not use the int main() no-arg variant? Then you can be sure not to get trolled by unused argument warnings.

@illwieckz
Copy link
Member Author

Why not use the int main() no-arg variant? Then you can be sure not to get trolled by unused argument warnings.

I have no opinion on this. If it is preferred at some point we can do that too, but right now it works so let's consider it fine.

Also the int main(int argc, char** argv) variant is now used for years in the DæmonArchitecture code so let's stick to that for now.

@illwieckz illwieckz merged commit 0bdb698 into master Jan 20, 2025
9 checks passed
@illwieckz illwieckz deleted the illwieckz/no-omit-parameter branch January 20, 2025 02:57
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.

Compiler detection is flaky and spews errors
3 participants