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

Jakub Jelinek jakub at redhat.com
Wed Feb 13 15:03:10 UTC 2008


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 at 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




More information about the devel mailing list