Please Help - 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: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 }
};
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.
Hello coder777
Its nice of you to give help mate :)
I am compiling this to support both arch (x32 & x64). I have no issue if i compile for x64 only. Link is the full content of the .C
http://pastebin.com/LsRqTYnV

Thank You so much!
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
i tried C99 but same issue :(
This only happen if i compile it both x32 & x64. No problem on x64 compiling
Topic archived. No new replies allowed.