#28 error: attributes are not allowed on a function-definition

closed-fixed
nobody
None
5
2012-03-10
2012-01-13
Anonymous
No

Hi all,

It seems that there is an error in libjson.h. I write a little patch to fix this problem see attachment.

============================================================
libjson version: 7.4.1 target: OS: Linux
============================================================
mkdir -p Objects_static
g++ Source/internalJSONNode.cpp -o Objects_static/internalJSONNode.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONAllocator.cpp -o Objects_static/JSONAllocator.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSON_Base64.cpp -o Objects_static/JSON_Base64.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONChildren.cpp -o Objects_static/JSONChildren.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONDebug.cpp -o Objects_static/JSONDebug.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONIterators.cpp -o Objects_static/JSONIterators.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONMemory.cpp -o Objects_static/JSONMemory.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONNode.cpp -o Objects_static/JSONNode.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONNode_Mutex.cpp -o Objects_static/JSONNode_Mutex.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONPreparse.cpp -o Objects_static/JSONPreparse.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONStream.cpp -o Objects_static/JSONStream.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONValidator.cpp -o Objects_static/JSONValidator.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONWorker.cpp -o Objects_static/JSONWorker.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/JSONWriter.cpp -o Objects_static/JSONWriter.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
g++ Source/libjson.cpp -o Objects_static/libjson.o -c -O3 -ffast-math -fexpensive-optimizations -DNDEBUG
In file included from Source/libjson.cpp:8:0:
Source/../libjson.h:194:97: error: attributes are not allowed on a function-definition
Source/../libjson.h:198:82: error: attributes are not allowed on a function-definition
make: *** [Objects_static/libjson.o] Error 1

============================================================
GCC version: 4.5.3 (gcc -v)
============================================================
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.5.3-r1/work/gcc-4.5.3/configure --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.3 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/include/g++-v4 --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-altivec --disable-fixed-point --without-ppl --without-cloog --disable-lto --enable-nls --without-included-gettext --with-system-zlib --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.3/python --enable-checking=release --disable-libgcj --enable-languages=c,c++,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.5.3-r1 p1.0, pie-0.4.5'
Thread model: posix
gcc version 4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5)

Discussion

  • Sorry for the delay, this problem has already been fixed in the release candidate that is currently being unit tested.

     
    • status: open --> closed-fixed