Conditionally disabled asprintf::invalid on some OSes
This commit is contained in:
parent
2354ba6c78
commit
10a3cbb988
1 changed files with 9 additions and 4 deletions
|
@ -55,11 +55,16 @@ Theory((struct format_test *fmt), asprintf, valid) {
|
|||
free(actual);
|
||||
}
|
||||
|
||||
#if defined(__unix__) && defined(__GNUC__)
|
||||
# pragma GCC diagnostic ignored "-Wformat"
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
# ifdef __GNUC__
|
||||
# pragma GCC diagnostic ignored "-Wformat"
|
||||
# endif
|
||||
# define ASPRINTF_INVALID_DISABLED 0
|
||||
#else
|
||||
# define ASPRINTF_INVALID_DISABLED 1
|
||||
#endif
|
||||
|
||||
Test(asprintf, invalid) {
|
||||
Test(asprintf, invalid, .disabled = ASPRINTF_INVALID_DISABLED) {
|
||||
char *actual;
|
||||
cr_expect_lt(cr_asprintf(&actual, "%"), 0);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue