Bug 57020 - error: expected expression before ‘)’ token
Summary: error: expected expression before ‘)’ token
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-21 06:57 UTC by Alan Aversa
Modified: 2018-03-27 15:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2013-04-21 00:00:00


Attachments
full source file (1.69 KB, text/x-chdr)
2013-04-21 06:57 UTC, Alan Aversa
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Aversa 2013-04-21 06:57:50 UTC
Created attachment 29908 [details]
full source file

I get this error:

elist.h:184:10: error: expected expression before ‘)’ token
  ((type *)((char *)(ptr)-(intptr_t)(&((type *)0)->member)))
          ^

Full code snippet:
#define list_entry(ptr, type, member) \
	((type *)((char *)(ptr)-(intptr_t)(&((type *)0)->member)))
Comment 1 Andrew Pinski 2013-04-21 07:15:41 UTC
This is not the full source which is having issues.
This is only the header file where the #define is located.
I suspect you are using list_entry incorrectly.  Though the error message could be better.
Comment 2 Manuel López-Ibáñez 2013-04-21 12:58:59 UTC
Please provide a minimal self-contained testcase showing the problem.
Comment 3 Marek Polacek 2013-10-21 20:50:04 UTC
Testcase not coming.