<< Back to previous view

[PCC-199] cpp: syntax error (wrong VA_ARGS expansion) Created: 03/Dec/10  Updated: 03/Dec/10

Status: Closed
Project: pcc
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: andre f. Assignee: Anders Magnusson
Resolution: Fixed Votes: 0
Environment: pcc 101201 on OpenBSD 4.7 amd64 compiling OpenBSD 4.6 kernel source (GENERIC kernel config)


 Description   
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)'


 Comments   
Comment by Anders Magnusson [ 03/Dec/10 10:13 AM ]
This is another coding bug that slipped gcc and is fixed in later versions of the source code.
The 4.6 source code contains coding bugs that do not pass neither gcc nor pcc anymore.
Generated at Fri Oct 31 23:56:25 CET 2014 using JIRA Enterprise Edition, Version: 3.13.1-#333.