Compile error when including xenctrl.h
Hello,
by trying to compile a C++ source having included "xencrtl.h" I got the following errors on g++ (gcc version 4.1.2 20061115) and XEN-3.0.4-1:
/usr/include/xenctrl.h:707: error: duplicate 'const' /usr/include/xenctrl.h:714: error: duplicate 'const' /usr/include/xenctrl.h:719: error: duplicate 'const'
By changing
line 707 from
const xc_error const *xc_get_last_error(void);
toxc_error const *xc_get_last_error(void);
line 714 from
typedef void (*xc_error_handler)(const xc_error const* err); to
typedef void (*xc_error_handler)(xc_error const* err);
line 719 from
void xc_default_error_handler(const xc_error const* err); to
void xc_default_error_handler(xc_error const* err);
these errors could be solved.
Any comments?
Regards,
Reiner
Quoted 3 lines · Reiner Dassing
these errors could be solved.
Any comments?
I think it's the const before the * that is bogus. It's probably meant to be after the *, otherwise it probably can be interpreted as a duplicate of the const before the type name. That const can be removed entirely in fact, as the const-ness of the pointer itself is quite uninteresting: it's the thing pointed at that we care about the const-ness of.
So, e.g., I'll change it to const xc_error *xc_get_last_error(void);
-- Keir