Samba fails to compile with cmocka >= 2.0 (e.g., libcmocka-2.0.2 as shipped in Fedora 44) due to a conflict between a forward declaration of cm_print_error() in Samba test source files and the cmocka.h header, which redefines cm_print_error as a deprecated compatibility macro (using do { ... } while(0)) wrapping the new cmocka_print_error() function. The build fails in two test files: source4/dsdb/samdb/ldb_modules/tests/test_group_audit.c: source4/dsdb/samdb/ldb_modules/tests/test_group_audit.c:110:6: error: expected identifier or '(' before 'do' 110 | void cm_print_error(const char * const format, ...); | ^~~~~~~~~~~~~~ source4/dsdb/samdb/ldb_modules/tests/test_group_audit.c:110:6: error: expected identifier or '(' before 'while' 110 | void cm_print_error(const char * const format, ...); | ^~~~~~~~~~~~~~ libcli/ldap/tests/ldap_message_test.c: libcli/ldap/tests/ldap_message_test.c:50:6: error: expected identifier or '(' before 'do' 50 | void cm_print_error(const char * const format, ...); | ^~~~~~~~~~~~~~ libcli/ldap/tests/ldap_message_test.c:50:6: error: expected identifier or '(' before 'while' 50 | void cm_print_error(const char * const format, ...); | ^~~~~~~~~~~~~~ Additional notes: The root cause is that both files contain explicit forward declarations of cm_print_error() which was previously an internal cmocka function. In cmocka >= 2.0, cm_print_error is a macro, so void cm_print_error(...) is expanded by the preprocessor into invalid syntax. Additionally, cmocka >= 2.0 requires <stdint.h> to be included before <cmocka.h>, which is missing from several test files.
Created attachment 19137 [details] patch from master for v4-23-test
can you also please add BUG: lines to each of the commits?
Created attachment 19144 [details] patch from master for v4-23-test
Comment on attachment 19144 [details] patch from master for v4-23-test this doesn't compile successfully with enable-developer in autobuild
Created attachment 19148 [details] patch from master for v4-23-test v2
Comment on attachment 19148 [details] patch from master for v4-23-test v2 lgtm
Created attachment 19149 [details] patch from master for v4-23-test v2
This bug was referenced in samba v4-23-test: 43643e440dbd938a0b26a2a8f95f481bc72a387c c6c02cffa96dd0b647317d3af9a3bbcb56e826cf 1ea76986e4be355f9f5f0d2f78aa73e220bbc58f b73a7d4188dbd0b3d064081462287dc25f0ae433 23a748cf39e584a447da96536c27d056381dfe4e