Bug 244695 - syntax error in include/asm/page.h?
syntax error in include/asm/page.h?
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Kernel Maintainer List
Brian Brock
:
: 244696 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-18 12:19 EDT by Jonathan Kamens
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-06-18 21:14:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jonathan Kamens 2007-06-18 12:19:44 EDT
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 12:21:54 EDT
*** Bug 244696 has been marked as a duplicate of this bug. ***
Comment 2 Chuck Ebbert 2007-06-18 21:13:58 EDT
This is a vmware problem, they need to change their code.
Kernel headers have never supported c++ compilation, and never will AFAICT.

Note You need to log in before you can comment on or make changes to this bug.