From: Michal Marek Date: Thu, 3 Feb 2011 22:57:09 +0000 (+0100) Subject: genksyms: Track changes to enum constants X-Git-Tag: v2.6.39-rc1~391^2~1^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e37ddb82500393cb417c3ab0fe0726d9a8652372;p=pandora-kernel.git genksyms: Track changes to enum constants Enum constants can be used as array sizes; if the enum itself does not appear in the symbol expansion, a change in the enum constant will go unnoticed. Example patch that changes the ABI but does not change the checksum with current genksyms: | enum e { | E1, | E2, |+ E3, | E_MAX | }; | | struct s { | int a[E_MAX]; | } | | int f(struct s *s) { ... } | EXPORT_SYMBOL(f) Therefore, remember the value of each enum constant and expand each occurence to . The value is not actually computed, but instead an expression in the form (last explicitly assigned value) + N is used. This avoids having to parse and semantically understand whole of C. Note: The changes won't take effect until the lexer and parser are rebuilt by the next patch. Signed-off-by: Michal Marek Acked-by: Sam Ravnborg --- Reading git-diff-tree failed