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

Build fails with -Werror=missing-declarations when UNITY_USE_COMMAND_LINE_ARGS is enabled #727

Closed
mchernosky opened this issue Apr 26, 2024 · 1 comment · Fixed by #728
Closed

Comments

@mchernosky
Copy link
Contributor

Run cmake with:

cmake -DCMAKE_C_FLAGS="-DUNITY_USE_COMMAND_LINE_ARGS" -B build -S .

Then build with cmake --build build, and get these errors:

Unity/src/unity.c:2354:5: error: no previous declaration for ‘IsStringInBiggerString’ [-Werror=missing-declarations]
 2354 | int IsStringInBiggerString(const char* longstring, const char* shortstring)
      |     ^~~~~~~~~~~~~~~~~~~~~~
Unity/src/unity.c:2399:5: error: no previous declaration for ‘UnityStringArgumentMatches’ [-Werror=missing-declarations]
 2399 | int UnityStringArgumentMatches(const char* str)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
gmake[2]: *** [CMakeFiles/unity.dir/build.make:76: CMakeFiles/unity.dir/src/unity.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/unity.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

The complier is: GNU 11.4.0

@mchernosky
Copy link
Contributor Author

I have in incoming PR to fix this by marking these functions as static.

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 a pull request may close this issue.

1 participant