mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 10:49:24 +00:00
build: wrap "fallthrough" attr
This generates a warning on gcc versions before 7.0. Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
parent
5ab5e410d0
commit
bd27ea43e9
@ -24,6 +24,9 @@
|
|||||||
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
|
#if __clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 5)
|
||||||
# define _RET_NONNULL , returns_nonnull
|
# define _RET_NONNULL , returns_nonnull
|
||||||
#endif
|
#endif
|
||||||
|
#if __has_attribute(fallthrough)
|
||||||
|
# define _FALLTHROUGH __attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
# define _CONSTRUCTOR(x) constructor(x)
|
# define _CONSTRUCTOR(x) constructor(x)
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
|
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9)
|
||||||
@ -34,6 +37,9 @@
|
|||||||
# define _DESTRUCTOR(x) destructor(x)
|
# define _DESTRUCTOR(x) destructor(x)
|
||||||
# define _ALLOC_SIZE(x) alloc_size(x)
|
# define _ALLOC_SIZE(x) alloc_size(x)
|
||||||
#endif
|
#endif
|
||||||
|
#if __GNUC__ >= 7
|
||||||
|
# define _FALLTHROUGH __attribute__((fallthrough));
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __sun
|
#ifdef __sun
|
||||||
@ -55,6 +61,9 @@
|
|||||||
#ifndef _ALLOC_SIZE
|
#ifndef _ALLOC_SIZE
|
||||||
# define _ALLOC_SIZE(x)
|
# define _ALLOC_SIZE(x)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _FALLTHROUGH
|
||||||
|
#define _FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* for warnings on macros, put in the macro content like this:
|
* for warnings on macros, put in the macro content like this:
|
||||||
|
@ -821,7 +821,7 @@ static void parse_test(struct peer *peer, struct test_segment *t, int type)
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case CAPABILITY:
|
case CAPABILITY:
|
||||||
len += 2; /* to cover the OPT-Param header */
|
len += 2; /* to cover the OPT-Param header */
|
||||||
__attribute__ ((fallthrough));
|
_FALLTHROUGH
|
||||||
case OPT_PARAM:
|
case OPT_PARAM:
|
||||||
printf("len: %u\n", len);
|
printf("len: %u\n", len);
|
||||||
/* peek_for_as4 wants getp at capibility*/
|
/* peek_for_as4 wants getp at capibility*/
|
||||||
|
Loading…
Reference in New Issue
Block a user