illwieckz · GitHub

@illwieckz

Copy link Copy Markdown

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).

Closed

@illwieckz

VReaperV

Copy link Copy Markdown

Contributor

Choose a reason for hiding this comment

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

LGTM

@slipher

Copy link Copy Markdown

Member

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 Copy Markdown

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

illwieckz deleted the illwieckz/no-omit-parameter branch

January 20, 2025 02:57

Read the original on github.com ↗