compile error in atomic.h when compiling c++

Ian Lepore ian at FreeBSD.org
Tue Sep 9 13:51:55 UTC 2014


On Tue, 2014-09-09 at 06:02 +0200, Bernd Walter wrote:
> System is r271289M with clang.
> 
> [114]wandboard# cat test.cc 
> #include <sys/types.h>
> #include <machine/atomic.h>
> 
> int
> main(int argc, char *argv[])
> {
>         return 0;
> }
> 
> [115]wandboard# c++ -Wall test.cc
> In file included from test.cc:2:
> /usr/include/machine/atomic.h:286:8: error: expected identifier
>                     [new]    "r"    (newval)
>                      ^
> /usr/include/machine/atomic.h:286:11: error: expected expression
>                     [new]    "r"    (newval)
>                         ^
> 2 errors generated.
> Exit 1
> 
> I assume it has problems with "new" used here, which is a special
> keyword in C++.
> 

My bad, fixed in r271310.

Jeez, I used to be able to call myself "mostly a C++ programmer" and
would automatically not make such a mistake.  For the past couple years
it seems all I've written is C.

-- Ian




More information about the freebsd-arm mailing list