diff --git a/lib/memory.h b/lib/memory.h index c95602f48538..459ee283aa49 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -142,6 +142,16 @@ struct memgroup { } \ MACRO_REQUIRE_SEMICOLON() /* end */ +#ifdef __INTELLISENSE__ +/* + * Fix Visual Studio Code error: attribute "constructor" does not take + * arguments. + * + * Caused by the macro `DEFINE_MTYPE_ATTR`. + */ +#pragma diag_suppress 1094 +#endif /* __INTELISENSE__ */ + #define DEFINE_MTYPE(group, name, desc) \ DEFINE_MTYPE_ATTR(group, name, , desc) \ /* end */ diff --git a/lib/prefix.h b/lib/prefix.h index c67656cfd134..4b054f0101b3 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -335,6 +335,17 @@ union prefixconstptr { prefixtype(prefixconstptr, const struct prefix_rd, rd) } TRANSPARENT_UNION; +#ifdef __INTELLISENSE__ +/* + * Fix Visual Studio Code error: argument of type "struct prefix *" is + * incompatible with parameter of type "union prefixptr". + * + * This is caused by all functions having the transparent unions in the + * prototype: `prefixptr` and `prefixconstptr`. + */ +#pragma diag_suppress 167 +#endif /* __INTELISENSE__ */ + #ifndef INET_ADDRSTRLEN #define INET_ADDRSTRLEN 16 #endif /* INET_ADDRSTRLEN */