-
Notifications
You must be signed in to change notification settings - Fork 162
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
Using FAKE_VOID_FUNC on vsyslog cause a sizeof-array-argument error #75
Comments
I run into the same issues, is there already a work-a-round available? |
Same here. Did anyone come up with a solution yet? Thanks. GREAT Framework BTW Mike. Only found it recently! |
Looks like it's hard to find info on mocking functions that take array arguments. |
Similar issue here.
gcc version: cc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 |
Describe the bug
FAKE_VALUE_FUNC(vsyslog, int, const char*, va_list);
is causing a sizeof of va_list which gcc turns into an error and therefore trigger the error sizeof-array-argument
To Reproduce
Compile the above
Expected behavior
detect array type and not call sizeof on them?
Screenshots
In file included from /home/ykoehler/fake_log.cpp:18:
/home/ykoehler/fake_log.cpp: In function ‘void vsyslog(int, const char*, __va_list_tag*)’:
/home/ykoehler/fff/include/fff.h:69:79: error: ‘sizeof’ on array function parameter ‘arg2’ will return size of ‘__va_list_tag*’ [-Werror=sizeof-array-argument]
memcpy((void*)&FUNCNAME##_fake.arg##n##_val, (void*)&arg##n, sizeof(arg##n));
Compiler, toolset, platform (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: