[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Another 4.3 c++ question.... (vmware kernel g++ module rebuild issue)



On Wed, Feb 13, 2008 at 06:53:48AM -0800, Tom London wrote:
> vmware module rebuild fails with kernel-2.6.25-0.35.rc1.fc9.i686 (and
> gcc-c++-4.3.0-0.7.i386?).
> 
> The following code from <asm/page.h> compiles fine with gcc but not with g++:
> 
> typedef int pteval_t;
> 
> struct pte_t {
>         pteval_t pte;
>         int junk;
> };
> 
> typedef struct pte_t pte_t;
> 
> static inline pte_t native_make_pte(pteval_t val)
> {
>         return (pte_t) { .pte = val };
> }
> 
> [tbl localhost ~]$ g++ -S t.c
> t.c: In function 'pte_t native_make_pte(pteval_t)':
> t.c:12: error: expected primary-expression before ')' token
> t.c:12: error: expected ';' before '{' token
> t.c:12: error: expected primary-expression before '.' token
> t.c:12: error: expected `;' before '}' token
> 
> 
> Has 4.3 g++ changed the acceptability of the "designated initializer"
> in the return?

No, if you try g++ 4.1.x, it will fail the same way.
Really, C is not a subset of C++, it is a different language, and this
header is written in C (particularly ISO C99).

Why are you trying to compile vmware with g++ rather than gcc?

	Jakub


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]