Closed GoogleCodeExporter closed 9 years ago
Thanks for reporting. Could you tell me which version of gcc did you use? I
can't reproduce your error here with gcc 4.7.1, and the designators are
supported by the c99 and c11 standards. Anyway, I just committed a patch that
explicitly specifying the gnu99 standard for compiling. Please tell me if that
solves your problem.
Original comment by eric.zltan@gmail.com
on 5 Apr 2013 at 1:00
Hi,
My gcc version is 4.6.3:
lch@hyperstream:/DT/local/ulib-svn$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-gnu-unique-object --enable-plugin --enable-objc-gc
--disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)
I just take the source from svn, but compilation fail at same point:
-e GEN hash_chain_r1.test
In file included from ../include/ulib/os_typelock.h:30:0,
from ../include/ulib/os_regionlock.h:32,
from ../include/ulib/hash_chain_r.h:32,
from hash_chain_r1.cpp:3:
../include/ulib/os_spinlock.h: In function ‘void
spin_lock_ticket(ticket_lock_t*)’:
../include/ulib/os_spinlock.h:302:37: error: expected primary-expression
before ‘.’ token
../include/ulib/os_spinlock.h: In function ‘void
spin_wrlock_ticket(ticket_rwlock_t*)’:
../include/ulib/os_spinlock.h:357:39: error: expected primary-expression
before ‘.’ token
../include/ulib/os_spinlock.h: In function ‘void
spin_wrunlock_ticket(ticket_rwlock_t*)’:
../include/ulib/os_spinlock.h:375:39: error: expected primary-expression
before ‘.’ token
../include/ulib/os_spinlock.h: In function ‘void
spin_rdlock_ticket(ticket_rwlock_t*)’:
../include/ulib/os_spinlock.h:403:39: error: expected primary-expression
before ‘.’ token
I can do some more tests for you, if you wish
Original comment by laurent....@gmail.com
on 8 Apr 2013 at 8:22
It happens that the standard C++ doesn't support initialization with struct
designators, though newer g++'s and Intel C++ compiler do. It should compile
now.
Original comment by eric.zltan@gmail.com
on 9 Apr 2013 at 3:20
Thanks, its fixed :-)
But I have this small issue (I comment this line, and it's ok)
-e GEN hash_chain_r_bench.test
hash_chain_r_bench.cpp: In function ‘void constant_insert(long int, long
int)’:
hash_chain_r_bench.cpp:54:55: error: variable ‘it’ set but not used
[-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
Original comment by laurent....@gmail.com
on 10 Apr 2013 at 10:00
Hi Laurent,
You can simply ignore this warning. Actually, the variable 'it' is to tell the
compiler not to optimize the statement out, which is required for some
compilers.
Original comment by eric.zltan@gmail.com
on 10 Apr 2013 at 10:10
Original issue reported on code.google.com by
laurent....@gmail.com
on 4 Apr 2013 at 1:42