Open grasmanek94 opened 3 years ago
Is there a way to mock functions which accept function pointers as parameters?
typedef int mbedtls_ctr_drbg_context; typedef int (*f_entropy_t)(void*, unsigned char*, size_t); int mbedtls_ctr_drbg_seed(mbedtls_ctr_drbg_context* ctx, f_entropy_t f_entropy, void* p_entropy, const unsigned char* custom, size_t len) { return 0; } mmk_mock_define( mbedtls_ctr_drbg_seed_mock, int, mbedtls_ctr_drbg_context*, f_entropy_t, void*, const unsigned char*, size_t ); void test_simple_case_b(void) { mbedtls_ctr_drbg_seed_mock mcdsm = mmk_mock("mbedtls_ctr_drbg_seed", mbedtls_ctr_drbg_seed_mock); mmk_assert((mmk_fn)mcdsm != MMK_MOCK_INVALID); mmk_when( mbedtls_ctr_drbg_seed( mmk_any(mbedtls_ctr_drbg_context*), mmk_any(f_entropy_t), mmk_any(void*), mmk_any(const unsigned char*), mmk_any(size_t) ), .then_return = &(int) { 1 } ); mmk_reset(mbedtls_ctr_drbg_seed); }
Results in:
# make [ 10%] Built target strdup [ 70%] Built target mimick Scanning dependencies of target strdup_test [ 75%] Building C object sample/strdup/CMakeFiles/strdup_test.dir/test.c.o In file included from ~/Mimick/include/mimick.h:28, from ~/Mimick/sample/strdup/test.c:1: ~/Mimick/sample/strdup/test.c: In function ‘mmkuser_mbedtls_ctr_drbg_seed_mock_stub’: ~/Mimick/include/mimick/mock.h:150:31: error: ISO C forbids ordered comparisons of pointers to functions [-Werror=pedantic] 150 | if (p->param ## N < param ## N \ | ^ ~/Mimick/include/mimick/preprocess.h:40:24: note: in definition of macro ‘MMK_EXPAND’ 40 | # define MMK_EXPAND(x) x | ^ ~/Mimick/include/mimick/mock.h:416:5: note: in expansion of macro ‘MMK_EXPAND’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:54: note: in expansion of macro ‘MMK_EXPAND’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:57: note: in expansion of macro ‘MMK_EXPAND’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:42: note: in expansion of macro ‘MMK_EXPAND’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:600:42: note: in expansion of macro ‘MMK_EXPAND’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:60: note: in expansion of macro ‘MMK_EXPAND’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:318:21: note: in expansion of macro ‘MMK_EXPAND’ 318 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYVERIFY, Id, __VA_ARGS__)) \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:27: note: in expansion of macro ‘MMK_EXPAND’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:49: note: in expansion of macro ‘MMK_EXPAND’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:45: note: in expansion of macro ‘MMK_EXPAND’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:45: note: in expansion of macro ‘MMK_EXPAND’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:58: note: in expansion of macro ‘MMK_EXPAND’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:45: note: in expansion of macro ‘MMK_EXPAND’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:46: note: in expansion of macro ‘MMK_EXPAND’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:47: note: in expansion of macro ‘MMK_EXPAND’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:92:76: note: in expansion of macro ‘MMK_EXPAND’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:139:36: note: in expansion of macro ‘MMK_EXPAND’ 139 | # define MMK_TRYVERIFY(N, Name, T) MMK_EXPAND(MMK_TRYVERIFY_(N, Name, T)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:52: note: in expansion of macro ‘MMK_EXPAND’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:55: note: in expansion of macro ‘MMK_EXPAND’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:40: note: in expansion of macro ‘MMK_EXPAND’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:613:40: note: in expansion of macro ‘MMK_EXPAND’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:58: note: in expansion of macro ‘MMK_EXPAND’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:132:5: note: in expansion of macro ‘MMK_EXPAND’ 132 | MMK_EXPAND(MMK_TRYVERIFY_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:132:16: note: in expansion of macro ‘MMK_TRYVERIFY_VA_WITHOU ’ 132 | MMK_EXPAND(MMK_TRYVERIFY_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:69: note: in expansion of macro ‘MMK_TRYVERIFY_VA’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:613:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_1’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:66: note: in expansion of macro ‘MMK_VA_SELECT_HELPER’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:63: note: in expansion of macro ‘MMK_VA_SELECT’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:137:5: note: in expansion of macro ‘MMK_COND_VA’ 137 | MMK_COND_VA(MMK_TRYVERIFY_VA, (WITHOUT, N, Name, T,), (WITH,), T) | ^~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:139:47: note: in expansion of macro ‘MMK_TRYVERIFY_’ 139 | # define MMK_TRYVERIFY(N, Name, T) MMK_EXPAND(MMK_TRYVERIFY_(N, Name, T)) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:91:53: note: in expansion of macro ‘MMK_TRYVERIFY’ 91 | # define MMK_APPLY_N5(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N4 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:92:87: note: in expansion of macro ‘MMK_APPLY_N5’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:58: note: in expansion of macro ‘MMK_APPLY_N6’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:57: note: in expansion of macro ‘MMK_APPLY_N__’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:56: note: in expansion of macro ‘MMK_APPLY_N_’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:69: note: in expansion of macro ‘MMK_APPLY_N_NE’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_2’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:60: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:38: note: in expansion of macro ‘MMK_APPLY_N_SELEC ’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:318:32: note: in expansion of macro ‘MMK_APPLY_N’ 318 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYVERIFY, Id, __VA_ARGS__)) \ | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:71: note: in expansion of macro ‘MMK_MOCK_DEFINE’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:600:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_1’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:68: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:65: note: in expansion of macro ‘MMK_VOID_SELECT’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:416:16: note: in expansion of macro ‘MMK_COND_VOID’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:407:16: note: in expansion of macro ‘MMK_MOCK_DEFINE_IMPL’ 407 | MMK_EXPAND(MMK_MOCK_DEFINE_IMPL(Id, \ | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/sample/strdup/test.c:43:1: note: in expansion of macro ‘mmk_mock_define’ 43 | mmk_mock_define( | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:153:31: error: ISO C forbids ordered comparisons of pointers to functions [-Werror=pedantic] 153 | if (p->param ## N > param ## N \ | ^ ~/Mimick/include/mimick/preprocess.h:40:24: note: in definition of macro ‘MMK_EXPAND’ 40 | # define MMK_EXPAND(x) x | ^ ~/Mimick/include/mimick/mock.h:416:5: note: in expansion of macro ‘MMK_EXPAND’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:54: note: in expansion of macro ‘MMK_EXPAND’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:57: note: in expansion of macro ‘MMK_EXPAND’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:42: note: in expansion of macro ‘MMK_EXPAND’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:600:42: note: in expansion of macro ‘MMK_EXPAND’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:60: note: in expansion of macro ‘MMK_EXPAND’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:318:21: note: in expansion of macro ‘MMK_EXPAND’ 318 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYVERIFY, Id, __VA_ARGS__)) \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:27: note: in expansion of macro ‘MMK_EXPAND’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:49: note: in expansion of macro ‘MMK_EXPAND’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:45: note: in expansion of macro ‘MMK_EXPAND’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:45: note: in expansion of macro ‘MMK_EXPAND’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:58: note: in expansion of macro ‘MMK_EXPAND’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:45: note: in expansion of macro ‘MMK_EXPAND’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:46: note: in expansion of macro ‘MMK_EXPAND’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:47: note: in expansion of macro ‘MMK_EXPAND’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:92:76: note: in expansion of macro ‘MMK_EXPAND’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:139:36: note: in expansion of macro ‘MMK_EXPAND’ 139 | # define MMK_TRYVERIFY(N, Name, T) MMK_EXPAND(MMK_TRYVERIFY_(N, Name, T)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:52: note: in expansion of macro ‘MMK_EXPAND’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:55: note: in expansion of macro ‘MMK_EXPAND’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:40: note: in expansion of macro ‘MMK_EXPAND’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:613:40: note: in expansion of macro ‘MMK_EXPAND’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:58: note: in expansion of macro ‘MMK_EXPAND’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:132:5: note: in expansion of macro ‘MMK_EXPAND’ 132 | MMK_EXPAND(MMK_TRYVERIFY_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:132:16: note: in expansion of macro ‘MMK_TRYVERIFY_VA_WITHOU ’ 132 | MMK_EXPAND(MMK_TRYVERIFY_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:69: note: in expansion of macro ‘MMK_TRYVERIFY_VA’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:613:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_1’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:66: note: in expansion of macro ‘MMK_VA_SELECT_HELPER’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:63: note: in expansion of macro ‘MMK_VA_SELECT’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:137:5: note: in expansion of macro ‘MMK_COND_VA’ 137 | MMK_COND_VA(MMK_TRYVERIFY_VA, (WITHOUT, N, Name, T,), (WITH,), T) | ^~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:139:47: note: in expansion of macro ‘MMK_TRYVERIFY_’ 139 | # define MMK_TRYVERIFY(N, Name, T) MMK_EXPAND(MMK_TRYVERIFY_(N, Name, T)) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:91:53: note: in expansion of macro ‘MMK_TRYVERIFY’ 91 | # define MMK_APPLY_N5(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N4 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:92:87: note: in expansion of macro ‘MMK_APPLY_N5’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:58: note: in expansion of macro ‘MMK_APPLY_N6’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:57: note: in expansion of macro ‘MMK_APPLY_N__’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:56: note: in expansion of macro ‘MMK_APPLY_N_’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:69: note: in expansion of macro ‘MMK_APPLY_N_NE’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_2’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:60: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:38: note: in expansion of macro ‘MMK_APPLY_N_SELEC ’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:318:32: note: in expansion of macro ‘MMK_APPLY_N’ 318 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYVERIFY, Id, __VA_ARGS__)) \ | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:71: note: in expansion of macro ‘MMK_MOCK_DEFINE’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:600:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_1’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:68: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:65: note: in expansion of macro ‘MMK_VOID_SELECT’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:416:16: note: in expansion of macro ‘MMK_COND_VOID’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:407:16: note: in expansion of macro ‘MMK_MOCK_DEFINE_IMPL’ 407 | MMK_EXPAND(MMK_MOCK_DEFINE_IMPL(Id, \ | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/sample/strdup/test.c:43:1: note: in expansion of macro ‘mmk_mock_define’ 43 | mmk_mock_define( | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:115:28: error: ISO C forbids ordered comparisons of pointers to functions [-Werror=pedantic] 115 | if (param ## N < bind->params.param ## N \ | ^ ~/Mimick/include/mimick/preprocess.h:40:24: note: in definition of macro ‘MMK_EXPAND’ 40 | # define MMK_EXPAND(x) x | ^ ~/Mimick/include/mimick/mock.h:416:5: note: in expansion of macro ‘MMK_EXPAND’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:54: note: in expansion of macro ‘MMK_EXPAND’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:57: note: in expansion of macro ‘MMK_EXPAND’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:42: note: in expansion of macro ‘MMK_EXPAND’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:600:42: note: in expansion of macro ‘MMK_EXPAND’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:60: note: in expansion of macro ‘MMK_EXPAND’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:345:13: note: in expansion of macro ‘MMK_EXPAND’ 345 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYMATCH, Id, __VA_ARGS__)) \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:27: note: in expansion of macro ‘MMK_EXPAND’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:49: note: in expansion of macro ‘MMK_EXPAND’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:45: note: in expansion of macro ‘MMK_EXPAND’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:45: note: in expansion of macro ‘MMK_EXPAND’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:58: note: in expansion of macro ‘MMK_EXPAND’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:45: note: in expansion of macro ‘MMK_EXPAND’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:46: note: in expansion of macro ‘MMK_EXPAND’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:47: note: in expansion of macro ‘MMK_EXPAND’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:92:76: note: in expansion of macro ‘MMK_EXPAND’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:104:35: note: in expansion of macro ‘MMK_EXPAND’ 104 | # define MMK_TRYMATCH(N, Name, T) MMK_EXPAND(MMK_TRYMATCH_(N, Name, T)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:52: note: in expansion of macro ‘MMK_EXPAND’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:55: note: in expansion of macro ‘MMK_EXPAND’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:40: note: in expansion of macro ‘MMK_EXPAND’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:613:40: note: in expansion of macro ‘MMK_EXPAND’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:58: note: in expansion of macro ‘MMK_EXPAND’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:99:5: note: in expansion of macro ‘MMK_EXPAND’ 99 | MMK_EXPAND(MMK_TRYMATCH_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:99:16: note: in expansion of macro ‘MMK_TRYMATCH_VA_WITHOUT’ 99 | MMK_EXPAND(MMK_TRYMATCH_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:69: note: in expansion of macro ‘MMK_TRYMATCH_VA’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:613:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_1’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:66: note: in expansion of macro ‘MMK_VA_SELECT_HELPER’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:63: note: in expansion of macro ‘MMK_VA_SELECT’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:103:5: note: in expansion of macro ‘MMK_COND_VA’ 103 | MMK_COND_VA(MMK_TRYMATCH_VA, (WITHOUT, N, Name, T,), (WITH,), T) | ^~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:104:46: note: in expansion of macro ‘MMK_TRYMATCH_’ 104 | # define MMK_TRYMATCH(N, Name, T) MMK_EXPAND(MMK_TRYMATCH_(N, Name, T)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:91:53: note: in expansion of macro ‘MMK_TRYMATCH’ 91 | # define MMK_APPLY_N5(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N4 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:92:87: note: in expansion of macro ‘MMK_APPLY_N5’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:58: note: in expansion of macro ‘MMK_APPLY_N6’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:57: note: in expansion of macro ‘MMK_APPLY_N__’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:56: note: in expansion of macro ‘MMK_APPLY_N_’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:69: note: in expansion of macro ‘MMK_APPLY_N_NE’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_2’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:60: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:38: note: in expansion of macro ‘MMK_APPLY_N_SELEC ’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:345:24: note: in expansion of macro ‘MMK_APPLY_N’ 345 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYMATCH, Id, __VA_ARGS__)) \ | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:71: note: in expansion of macro ‘MMK_MOCK_DEFINE’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:600:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_1’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:68: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:65: note: in expansion of macro ‘MMK_VOID_SELECT’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:416:16: note: in expansion of macro ‘MMK_COND_VOID’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:407:16: note: in expansion of macro ‘MMK_MOCK_DEFINE_IMPL’ 407 | MMK_EXPAND(MMK_MOCK_DEFINE_IMPL(Id, \ | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/sample/strdup/test.c:43:1: note: in expansion of macro ‘mmk_mock_define’ 43 | mmk_mock_define( | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:118:28: error: ISO C forbids ordered comparisons of pointers to functions [-Werror=pedantic] 118 | if (param ## N > bind->params.param ## N \ | ^ ~/Mimick/include/mimick/preprocess.h:40:24: note: in definition of macro ‘MMK_EXPAND’ 40 | # define MMK_EXPAND(x) x | ^ ~/Mimick/include/mimick/mock.h:416:5: note: in expansion of macro ‘MMK_EXPAND’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:54: note: in expansion of macro ‘MMK_EXPAND’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:57: note: in expansion of macro ‘MMK_EXPAND’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:42: note: in expansion of macro ‘MMK_EXPAND’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:600:42: note: in expansion of macro ‘MMK_EXPAND’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:60: note: in expansion of macro ‘MMK_EXPAND’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:345:13: note: in expansion of macro ‘MMK_EXPAND’ 345 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYMATCH, Id, __VA_ARGS__)) \ | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:27: note: in expansion of macro ‘MMK_EXPAND’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:49: note: in expansion of macro ‘MMK_EXPAND’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:45: note: in expansion of macro ‘MMK_EXPAND’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:45: note: in expansion of macro ‘MMK_EXPAND’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:58: note: in expansion of macro ‘MMK_EXPAND’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:45: note: in expansion of macro ‘MMK_EXPAND’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:46: note: in expansion of macro ‘MMK_EXPAND’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:47: note: in expansion of macro ‘MMK_EXPAND’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:92:76: note: in expansion of macro ‘MMK_EXPAND’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:104:35: note: in expansion of macro ‘MMK_EXPAND’ 104 | # define MMK_TRYMATCH(N, Name, T) MMK_EXPAND(MMK_TRYMATCH_(N, Name, T)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:52: note: in expansion of macro ‘MMK_EXPAND’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:55: note: in expansion of macro ‘MMK_EXPAND’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:40: note: in expansion of macro ‘MMK_EXPAND’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:613:40: note: in expansion of macro ‘MMK_EXPAND’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:58: note: in expansion of macro ‘MMK_EXPAND’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:99:5: note: in expansion of macro ‘MMK_EXPAND’ 99 | MMK_EXPAND(MMK_TRYMATCH_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~ ~/Mimick/include/mimick/mock.h:99:16: note: in expansion of macro ‘MMK_TRYMATCH_VA_WITHOUT’ 99 | MMK_EXPAND(MMK_TRYMATCH_VA_ ## Id (__VA_ARGS__)) | ^~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:614:69: note: in expansion of macro ‘MMK_TRYMATCH_VA’ 614 | # define MMK_VA_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:613:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_1’ 613 | # define MMK_VA_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:612:51: note: in expansion of macro ‘MMK_VA_SELECT_HELPER_’ 612 | # define MMK_VA_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VA_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:610:66: note: in expansion of macro ‘MMK_VA_SELECT_HELPER’ 610 | # define MMK_VA_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VA_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VA_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:617:63: note: in expansion of macro ‘MMK_VA_SELECT’ 617 | # define MMK_COND_VA(Macro, Params1, Params2, Tok) MMK_EXPAND(MMK_VA_SELECT(Macro, Params1, Params2, Tok)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:103:5: note: in expansion of macro ‘MMK_COND_VA’ 103 | MMK_COND_VA(MMK_TRYMATCH_VA, (WITHOUT, N, Name, T,), (WITH,), T) | ^~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:104:46: note: in expansion of macro ‘MMK_TRYMATCH_’ 104 | # define MMK_TRYMATCH(N, Name, T) MMK_EXPAND(MMK_TRYMATCH_(N, Name, T)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:91:53: note: in expansion of macro ‘MMK_TRYMATCH’ 91 | # define MMK_APPLY_N5(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N4 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:92:87: note: in expansion of macro ‘MMK_APPLY_N5’ 92 | # define MMK_APPLY_N6(N, Macro, Prefix, Head, ...) Macro(N, Prefix, Head) MMK_EXPAND(MMK_APPLY_N5 (MMK_INC(N), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:153:58: note: in expansion of macro ‘MMK_APPLY_N6’ 153 | # define MMK_APPLY_N__(Macro, Prefix, n, ...) MMK_EXPAND(MMK_APPLY_N##n(0, Macro, Prefix, __VA_ARGS__,)) | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:154:57: note: in expansion of macro ‘MMK_APPLY_N__’ 154 | # define MMK_APPLY_N_(Macro, n, Prefix, ...) MMK_EXPAND(MMK_APPLY_N__(Macro, Prefix, n, __VA_ARGS__)) | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:155:56: note: in expansion of macro ‘MMK_APPLY_N_’ 155 | # define MMK_APPLY_N_NE(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_(Macro, MMK_VA_NARGS(,__VA_ARGS__), Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:162:69: note: in expansion of macro ‘MMK_APPLY_N_NE’ 162 | # define MMK_APPLY_N_SELECT_HELPER_2(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_NE(Macro, Prefix, MMK_VA_TAIL(__VA_ARGS__))) | ^~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:160:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_2’ 160 | # define MMK_APPLY_N_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:159:56: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER_’ 159 | # define MMK_APPLY_N_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:157:60: note: in expansion of macro ‘MMK_APPLY_N_SELECT_HELPER’ 157 | # define MMK_APPLY_N_SELECT(Macro, Prefix, ...) MMK_EXPAND(MMK_APPLY_N_SELECT_HELPER(MMK_VA_TAIL_SELECT(__VA_ARGS__), Macro, Prefix, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:164:38: note: in expansion of macro ‘MMK_APPLY_N_SELEC ’ 164 | # define MMK_APPLY_N(...) MMK_EXPAND(MMK_APPLY_N_SELECT(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:345:24: note: in expansion of macro ‘MMK_APPLY_N’ 345 | MMK_EXPAND(MMK_APPLY_N(MMK_TRYMATCH, Id, __VA_ARGS__)) \ | ^~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:601:71: note: in expansion of macro ‘MMK_MOCK_DEFINE’ 601 | # define MMK_VOID_SELECT_HELPER_1(Macro, Params1, Params2) MMK_EXPAND(Macro Params1) | ^~~~~ ~/Mimick/include/mimick/preprocess.h:600:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_1’ 600 | # define MMK_VOID_SELECT_HELPER_(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_##N(__VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:599:53: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER_’ 599 | # define MMK_VOID_SELECT_HELPER(N, ...) MMK_EXPAND(MMK_VOID_SELECT_HELPER_(N, __VA_ARGS__)) | ^~~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:597:68: note: in expansion of macro ‘MMK_VOID_SELECT_HELPER’ 597 | # define MMK_VOID_SELECT(Macro, Params1, Params2, Type) MMK_EXPAND(MMK_VOID_SELECT_HELPER(MMK_VA_TAIL_SELECT(MMK_VOID_SELECT_TYPE(Type)), Macro, Params1, Params2)) | ^~~~~~~~~~~~~~~~~~~~~~ ~/Mimick/include/mimick/preprocess.h:604:65: note: in expansion of macro ‘MMK_VOID_SELECT’ 604 | # define MMK_COND_VOID(Macro, Params1, Params2, ...) MMK_EXPAND(MMK_VOID_SELECT(Macro, Params1, Params2, __VA_ARGS__)) | ^~~~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:416:16: note: in expansion of macro ‘MMK_COND_VOID’ 416 | MMK_EXPAND(MMK_COND_VOID( \ | ^~~~~~~~~~~~~ ~/Mimick/include/mimick/mock.h:407:16: note: in expansion of macro ‘MMK_MOCK_DEFINE_IMPL’ 407 | MMK_EXPAND(MMK_MOCK_DEFINE_IMPL(Id, \ | ^~~~~~~~~~~~~~~~~~~~ ~/Mimick/sample/strdup/test.c:43:1: note: in expansion of macro ‘mmk_mock_define’ 43 | mmk_mock_define( | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [sample/strdup/CMakeFiles/strdup_test.dir/build.make:82: sample/strdup/CMakeFiles/strdup_test.dir/test.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:291: sample/strdup/CMakeFiles/strdup_test.dir/all] Error 2 make: *** [Makefile:160: all] Error 2
Is there a way to mock functions which accept function pointers as parameters?
Results in: