Bug 166331

Summary: /vm/vm.h:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vm_prot_t'
Product: Base System Reporter: Liu <liuw>
Component: i386Assignee: freebsd-i386 (Nobody) <i386>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 9.0-RELEASE   
Hardware: Any   
OS: Any   

Description Liu 2012-03-23 01:40:01 UTC
/*----------
  smc_os.h
----------*/
..
..
#include <vm/vm.h>
..

Compile error:

In file included from smc_os.h:6,
                 from smc_core_type.h:4,
                 from smc_core_sata.c:47:
@/vm/vm.h:73: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'vm_prot_t'
@/vm/vm.h:87: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'objtype_t'
@/vm/vm.h:133: error: expected specifier-qualifier-list before 'vm_offset_t'
@/vm/vm.h:145: error: expected ')' before 'incr'
@/vm/vm.h:146: error: expected ')' before 'incr'
@/vm/vm.h:147: error: expected ')' before 'incr'
@/vm/vm.h:148: error: expected ')' before 'decr'
@/vm/vm.h:149: error: expected ')' before 'decr'
In file included from /usr/home/Liuw/freebsddriverforaoc_sas2lp_mv8/machine/pmap.h:158,
                 from @/vm/pmap.h:89,
                 from smc_os.h:7,
                 from smc_core_type.h:4,
                 from smc_core_sata.c:47:
@/sys/_cpuset.h:49: error: 'MAXCPU' undeclared here (not in a function)
@/sys/_cpuset.h:49: error: 'NBBY' undeclared here (not in a function)
@/sys/_cpuset.h:49: error: variably modified '__bits' at file scope
In file included from /usr/home/Liuw/freebsddriverforaoc_sas2lp_mv8/machine/pmap.h:159,
                 from @/vm/pmap.h:89,
                 from smc_os.h:7,
                 from smc_core_type.h:4,
                 from smc_core_sata.c:47:
@/sys/_lock.h:36: error: expected specifier-qualifier-list before 'u_int'
In file included from /usr/home/Liuw/freebsddriverforaoc_sas2lp_mv8/machine/pmap.h:160,
                 from @/vm/pmap.h:89,
                 from smc_os.h:7,
                 from smc_core_type.h:4,
                 from smc_core_sata.c:47:
@/sys/_mutex.h:39: error: expected ':', ',', ';', '}' or '__attribute__' before 'mtx_lock'
In file included from @/vm/pmap.h:89,
                 from smc_os.h:7,
                 from smc_core_type.h:4,
                 from smc_core_sata.c:47:

Fix: 

investigating
How-To-Repeat: ..
#include <vm/vm.h>
..
Comment 1 Liu 2012-03-23 01:52:52 UTC
Resolved.
---------------------------------Fix:
#include <sys/types.h>
...
#include <vm/vm.h>
...
---------------------------------------------------------------------------------
Explanation:
vm.h refers to data type u_char which is defined in <sys/types.h>

Sincerely,
Liu
Comment 2 Marcelo Araujo freebsd_committer freebsd_triage 2012-03-23 03:16:24 UTC
State Changed
From-To: open->closed

It isn't a bug and the submitter found how to solve the issue by 
himself.