diff --git a/src/list.h b/src/list.h index 6ad384c..c15a78b 100644 --- a/src/list.h +++ b/src/list.h @@ -293,7 +293,7 @@ list_replace(struct list *old, struct list *new) #define __container_of(ptr, sample, member) \ (void *)((char *)(ptr) \ - - ((char *)&(sample)->member - (char *)(sample))) + - offsetof(__typeof(*sample), member)) /** * Loop through the list given by head and set pos to struct in the list. * diff --git a/src/xkbcomp/parser.y b/src/xkbcomp/parser.y index 2744881..ba26fde 100644 --- a/src/xkbcomp/parser.y +++ b/src/xkbcomp/parser.y @@ -28,6 +28,8 @@ #include "xkbcomp-priv.h" #include "parseutils.h" +#pragma GCC diagnostic ignored "-Wredundant-decls" + extern int yylex(union YYSTYPE *val, struct YYLTYPE *loc, void *scanner); #define scanner param->scanner diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h index c767b71..02501f1 100644 --- a/src/xkbcomp/parseutils.h +++ b/src/xkbcomp/parseutils.h @@ -30,7 +30,6 @@ #include #include "xkbcomp-priv.h" -#include "parser.h" struct parser_param { struct xkb_context *ctx; @@ -38,6 +37,8 @@ struct parser_param { XkbFile *rtrn; }; +#include "parser.h" + struct scanner_extra { char *scanFile; char scanBuf[1024]; diff --git a/src/xkbcomp/scanner.l b/src/xkbcomp/scanner.l index daf233a..39e8759 100644 --- a/src/xkbcomp/scanner.l +++ b/src/xkbcomp/scanner.l @@ -30,6 +30,9 @@ #include "xkbcomp-priv.h" #include "parseutils.h" +#pragma GCC diagnostic ignored "-Wredundant-decls" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" + extern int yyparse(struct parser_param *param); #define YY_USER_ACTION { \ diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c index e2ce206..3af053d 100644 --- a/src/xkbcomp/symbols.c +++ b/src/xkbcomp/symbols.c @@ -824,7 +824,8 @@ AddSymbolsToKey(KeyInfo *keyi, struct xkb_keymap *keymap, { xkb_group_index_t ndx; size_t nSyms, nLevels; - size_t i, j; + size_t i; + int j; if (!GetGroupIndex(keyi, keymap, arrayNdx, SYMBOLS, &ndx)) return false; @@ -1544,7 +1545,7 @@ PrepareKeyDef(KeyInfo *keyi) defined = keyi->symsDefined | keyi->actsDefined | keyi->typesDefined; /* get highest group number */ - for (i = XkbNumKbdGroups - 1; i >= 0; i--) { + for (i = XkbNumKbdGroups - 1; i > 0; i--) { if (defined & (1 << i)) break; }