Bug 244695

Summary: syntax error in include/asm/page.h?
Product: [Fedora] Fedora Reporter: Jonathan Kamens <jik>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: low Docs Contact:
Priority: low    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-06-19 01:14:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jonathan Kamens 2007-06-18 16:19:44 UTC
Trying to compile the VMware modules with 2.6.21-1.3223.fc8, I get:

include/asm/page.h: In function 'pte_t native_make_pte(long unsigned int)':
include/asm/page.h:112: error: expected primary-expression before ')' token
include/asm/page.h:112: error: expected ';' before '{' token
include/asm/page.h:112: error: expected primary-expression before '.' token
include/asm/page.h:112: error: expected `;' before '}' token

Note that this particular file is being compiled in C++ mode, not C mode.  The 
function in question is:

static inline pte_t native_make_pte(unsigned long val)
{
      return (pte_t) { .pte_low = val };
}

I made the problem go away by changing it to this:

static inline pte_t native_make_pte(unsigned long val)
{
  pte_t ret;
  ret.pte_low = val;
  return ret;
  /*    return (pte_t) { .pte_low = val }; */
}

I can't claim to understand the niceties of C++ syntax enough to understand why 
the C++ compiler didn't like the previous syntax, nor do I know whether this is 
a problem with the header file or a problem with g++ (gcc-c++-4.1.2-13 is what 
I've got), so I'm making a best guess and filing under kernel.  Please reassign 
if appropriate.

Comment 1 Jonathan Kamens 2007-06-18 16:21:54 UTC
*** Bug 244696 has been marked as a duplicate of this bug. ***

Comment 2 Chuck Ebbert 2007-06-19 01:13:58 UTC
This is a vmware problem, they need to change their code.
Kernel headers have never supported c++ compilation, and never will AFAICT.