fff icon indicating copy to clipboard operation
fff copied to clipboard

fix FAKE_VALUE_FUNC example

Open mmitch opened this issue 5 years ago • 5 comments

This is a documentation update:

Functions without arguments need FAKE_VALUE_FUNC0 instead of FAKE_VALUE_FUNC, otherwise C compiler will emit warnings like ISO C99 requires at least one argument for the "..." in a variadic macro.

mmitch avatar Nov 25 '20 20:11 mmitch

:white_check_mark: Build fff 89-appveyor completed (commit https://github.com/meekrosoft/fff/commit/7e356d6225 by @mmitch)

AppVeyorBot avatar Nov 25 '20 20:11 AppVeyorBot

I just opened a pull request to fix this warning, so you won't need to use FAKE_VALUE_FUNC0 anymore.

rubiot avatar Apr 14 '21 12:04 rubiot

Your linked pull request does not resolve, did you mean https://github.com/meekrosoft/fff/pull/98?

mmitch avatar Apr 16 '21 19:04 mmitch

Ah, yes, sorry.

rubiot avatar Apr 16 '21 20:04 rubiot

I have applied your pull request to my project after reverting from FAKE_VALUE_FUNC0 to FAKE_VALUE_FUNC. See this branch here: https://github.com/mmitch/syndig/tree/warning-fix

While the GCC throws no pedantic errors after applying your patch, the clang build still fails. If I understand correctly, #pragma GCC system_header just disables the warnings, it does not fix anything about using the wrong macro. I think it's better to fix the code (by using ..._FUNC0 over ..._FUNC) instead of disabling the warnings and thus the example in the documentation should be updated to that regard instead.

(I was unsure if I should reply here or over at your pull request.)

mmitch avatar Apr 24 '21 20:04 mmitch