Issue Details (XML | Word | Printable)

Key: PCC-199
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: andre f.
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
pcc

cpp: syntax error (wrong VA_ARGS expansion)

Created: 03/Dec/10 09:49 AM   Updated: 03/Dec/10 10:13 AM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Environment: pcc 101201 on OpenBSD 4.7 amd64 compiling OpenBSD 4.6 kernel source (GENERIC kernel config)


 Description  « Hide
pcc 101201 on OpenBSD 4.7 amd64 compiling OpenBSD 4.6 kernel source (GENERIC kernel config)
fails in dev/pci/if_ix.c: line 1156: syntax error

the reduced code fragment triggering the error:
---
struct ixgbe_hw {
int (*init_hw)(struct ixgbe_hw *);
};

#define ixgbe_hw(hw, func, ...) (hw)->func(hw, ##__VA_ARGS__)

void ixgbe_hardware_init()
{
struct ixgbe_hw hw;

ixgbe_hw(&hw, init_hw);
}
---

cpp expands the macro to '(&hw)->init_hw(&hw,)'
wheres gcc does '(&hw)->init_hw(&hw)'


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson made changes - 03/Dec/10 10:10 AM
Field Original Value New Value
Assignee Anders Magnusson [ ragge ]
Anders Magnusson made changes - 03/Dec/10 10:13 AM
Status Open [ 1 ] Closed [ 6 ]
Resolution Fixed [ 1 ]