]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared/util.c: assert_cc() can only be used inside functions
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 3 Jun 2017 15:03:22 +0000 (17:03 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Mon, 5 Jun 2017 17:07:00 +0000 (10:07 -0700)
commitecab65b35c3c22af6a503486022ad8b85ccd1cad
treed4ab2baf279958a4a4e525fe4c3cbf49ed03b180
parentdf492f5ca3dc4d37323ee9e14fd4564e34264713
shared/util.c: assert_cc() can only be used inside functions

shared/macro.h has two versions of assert_cc, one that uses gcc
_Static_assert(), which requires recent enough gcc versions, and one
that uses a fake array to trigger a build error. The latter can only
work inside functions, so assert_cc() should only be used inside
functions.

Fixes the following build failure when building kmod with old gcc
versions such as gcc 4.3.x:

shared/util.c:52: error: expected identifier or '(' before 'do'
shared/util.c:52: error: expected identifier or '(' before 'while'

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
shared/util.c