[RTEMS Project] #3061: including 'unistd.h' in C++ does not build.
RTEMS trac
trac at rtems.org
Wed Jul 5 03:24:41 UTC 2017
#3061: including 'unistd.h' in C++ does not build.
-------------------------+-----------------------
Reporter: Chris Johns | Owner: chrisj@…
Type: defect | Status: new
Priority: highest | Milestone: 4.12.0
Component: tools | Version: 4.12
Severity: blocker | Resolution:
Keywords: |
-------------------------+-----------------------
Description changed by Chris Johns:
Old description:
> Including `unistd.h` in a C++ program does not compile:
>
> {{{
> $ /opt/work/rtems/4.12/bin/arm-rtems4.12-g++ -B/opt/work/rtems/4.12/arm-
> rtems4.12/xilinx_zynq_zc706/lib -B/opt/work/si/rtems/4.12/arm-
> rtems4.12/xilinx_zynq_zc706/lib -specs bsp_specs -qrtems -march=armv7-a
> -mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -g -O2 u.cpp
> In file included from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/_pthreadtypes.h:24:0,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/types.h:239,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/unistd.h:12,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/unistd.h:4,
> from u.cpp:6:
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function
> 'void CPU_AND_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:147:3: error:
> 'BIT_AND2' was not declared in this scope
> BIT_AND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:147:3: note:
> suggested alternative: 'BIT_AND'
> BIT_AND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~
> BIT_AND
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function
> 'void CPU_OR_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:159:3: error:
> 'BIT_OR2' was not declared in this scope
> BIT_OR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:159:3: note:
> suggested alternative: 'BIT_OR'
> BIT_OR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~
> BIT_OR
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function
> 'void CPU_XOR_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:171:3: error:
> 'BIT_XOR2' was not declared in this scope
> BIT_XOR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:171:3: note:
> suggested alternative: 'BIT_OR'
> BIT_XOR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~
> BIT_OR
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function
> 'void CPU_NAND_S(size_t, cpu_set_t*, const cpu_set_t*, const
> cpu_set_t*)':
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:183:3: error:
> 'BIT_NAND2' was not declared in this scope
> BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~~
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:183:3: note:
> suggested alternative: 'BIT_NAND'
> BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
> ^~~~~~~~~
> BIT_NAND
> In file included from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/cpuset.h:46:0,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/_pthreadtypes.h:24,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/types.h:239,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/sys/unistd.h:12,
> from /opt/work/rtems/4.12/arm-
> rtems4.12/include/unistd.h:4,
> from u.cpp:6:
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'int
> CPU_COUNT_S(size_t, const cpu_set_t*)':
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:194:10: error:
> '__bitcountl' was not declared in this scope
> return BIT_COUNT(_cpu_set_bits(setsize), set);
> ^
> /opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:194:10: note:
> suggested alternative: '__count'
> }}}
New description:
Including `unistd.h` in a C++ program does not compile with the RSB for
today:
{{{
$ /opt/work/rtems/4.12/bin/arm-rtems4.12-g++ -B/opt/work/rtems/4.12/arm-
rtems4.12/xilinx_zynq_zc706/lib -B/opt/work/si/rtems/4.12/arm-
rtems4.12/xilinx_zynq_zc706/lib -specs bsp_specs -qrtems -march=armv7-a
-mthumb -mfpu=neon -mfloat-abi=hard -mtune=cortex-a9 -g -O2 u.cpp
In file included from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/_pthreadtypes.h:24:0,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/types.h:239,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/unistd.h:12,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/unistd.h:4,
from u.cpp:6:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'void
CPU_AND_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:147:3: error:
'BIT_AND2' was not declared in this scope
BIT_AND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:147:3: note:
suggested alternative: 'BIT_AND'
BIT_AND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~
BIT_AND
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'void
CPU_OR_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:159:3: error:
'BIT_OR2' was not declared in this scope
BIT_OR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:159:3: note:
suggested alternative: 'BIT_OR'
BIT_OR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~
BIT_OR
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'void
CPU_XOR_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:171:3: error:
'BIT_XOR2' was not declared in this scope
BIT_XOR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:171:3: note:
suggested alternative: 'BIT_OR'
BIT_XOR2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~
BIT_OR
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'void
CPU_NAND_S(size_t, cpu_set_t*, const cpu_set_t*, const cpu_set_t*)':
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:183:3: error:
'BIT_NAND2' was not declared in this scope
BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~~
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:183:3: note:
suggested alternative: 'BIT_NAND'
BIT_NAND2(_cpu_set_bits(setsize), destset, srcset1, srcset2);
^~~~~~~~~
BIT_NAND
In file included from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/cpuset.h:46:0,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/_pthreadtypes.h:24,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/types.h:239,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/sys/unistd.h:12,
from /opt/work/rtems/4.12/arm-
rtems4.12/include/unistd.h:4,
from u.cpp:6:
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h: In function 'int
CPU_COUNT_S(size_t, const cpu_set_t*)':
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:194:10: error:
'__bitcountl' was not declared in this scope
return BIT_COUNT(_cpu_set_bits(setsize), set);
^
/opt/work/rtems/4.12/arm-rtems4.12/include/sys/cpuset.h:194:10: note:
suggested alternative: '__count'
}}}
--
--
Ticket URL: <http://devel.rtems.org/ticket/3061#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list