Fix a few issues with the C generator (part 6)#20332
Fix a few issues with the C generator (part 6)#20332wing328 merged 6 commits intoOpenAPITools:masterfrom
Conversation
Agreed. We definitely want to catch similar issues moving forward. |
To better test the output from C client generator, we can start using the Echo API server with the C Echo API client for better test coverage: https://github.com/OpenAPITools/openapi-generator/wiki/Integration-Tests#echo-server We're gradually migrating other generators to have Echo API client tests as well. |
|
I've been looking into it some more, and there was really nothing wrong with the patch by @bookerdj, he just forgot to update one line. So instead of reverting the whole thing, this pull request now fixes that one line. |
|
To be able to test @bookerdj's patch (so that nobody tries to revert it again like I did), I propose that we also add |
thanks for fixing it in this PR 👍
sounds good to me |
|
we can improve the CI tests to catch the warnings in another PR let's get this merged to keep the momentum going |
|
Thanks! The compiler flag changes are already included in this pull request, I guess I wasn't clear enough about that. Next pull request here: #20366. |
* [C] Fail build on implicit function declarations * [C] Complete changes from patch 34c3f8c * Update samples * [C] Fail build for global functions with no declaration * [C] Use "static" for apiClient.c internal functions * Update samples
|
Just dropping a comment to say great catch! Was experiencing this regression when using V7-10. Decided to get stuck into the inner workings of openApi C generator for version 7.10 and completely onboard with the new compiler flags. Rather more strict than not 👍 |
|
Thanks! You'll find that there are still many issues with the C generator, though. |
Before completing the pull request at #14379, I want to draw attention to a newer issue I've recently noticed. Building the petstore sample results in the following warnings:
These warnings are serious because they indicate that there is no definition anywhere for functions like statusorder_ToString(). It's a regression caused by commit
34c3f8c7aa84 ("[C][Client] Fix enum function names not matching headers in the model template (#17512)")(#17512, @bookerdj). The petstore schema covers this case, but the tests still pass because the warnings don't break the build.So I propose here:
Of course I'll appreciate any feedback on the matter.
@wing328 @ityuhui @zhemant @michelealbano