Mar 12, 2015 at 8:37am UTC
mydriver.cpp:32: error: expected primary-expression before '.' token
mydriver.cpp:32: error: expected primary-expression before '.' token
mydriver.cpp:32: error: expected primary-expression before '.' token
mydriver.cpp:32: error: expected primary-expression before '.' token
mydriver.cpp:33: error: expected primary-expression before '.' token
mydriver.cpp:33: error: expected primary-expression before '.' token
mydriver.cpp:33: error: expected primary-expression before '.' token
mydriver.cpp:33: error: expected primary-expression before '.' token
This is the snippet of the file:
static const struct intelDevice deviceTable[] = {
{ .pciDevId = E1000_DEV_ID_ICH8_IFE, .device = board_ich8lan, .deviceName = "82562V", .deviceInfo = &e1000_ich8_info },
{ .pciDevId = 0, .device = 0, .deviceName = NULL, .deviceInfo = NULL }
};
Mar 12, 2015 at 9:26am UTC
I'd guess that this code stems from another language.
Something like .pciDevId =
is not valid C/C++. Simply remove it. Note that the order is important.
Mar 12, 2015 at 9:58am UTC
Something like .pciDevId = is not valid C/C++. Simply remove it. Note that the order is important.
It is actually a valid C99 feature called designated initializers.
However it is not C++. Make sure that you are compiling it as C code and C99 support is turned on.
Last edited on Mar 12, 2015 at 9:59am UTC
Mar 12, 2015 at 10:28am UTC
i tried C99 but same issue :(
This only happen if i compile it both x32 & x64. No problem on x64 compiling