2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Import isc/list.h after cmocka to avoid redefinition errors

In file included from diff_test.c:25:
    /usr/local/include/cmocka.h:2333:1: error: unknown attribute '_Noreturn' ignored [-Werror,-Wunknown-attributes]
     2333 | CMOCKA_NORETURN void _fail(const char * const file, const int line);
          | ^~~~~~~~~~~~~~~
    /usr/local/include/cmocka.h:129:41: note: expanded from macro 'CMOCKA_NORETURN'
      129 | #define CMOCKA_NORETURN __attribute__ ((noreturn))
          |                                         ^~~~~~~~
    /usr/include/stdnoreturn.h:36:19: note: expanded from macro 'noreturn'
       36 | #define noreturn                _Noreturn
          |                                 ^~~~~~~~~
This commit is contained in:
Michal Nowak
2025-07-29 12:21:37 +02:00
parent da561d6b28
commit cb96d9c8e2

View File

@@ -19,13 +19,14 @@
#include <stdlib.h>
#include <unistd.h>
#include "isc/list.h"
#define UNIT_TESTING
#include <cmocka.h>
#include <dns/diff.h>
/* isc/list.h must be imported after cmocka to avoid redefinition errors */
#include <isc/list.h>
#include <tests/dns.h>
unsigned char data_1[] = "\006name_1";