g++ build failure

James E Keenan jkeen at verizon.net
Thu Sep 22 02:27:58 UTC 2011


commit 55a6542
branch: master
observed on: Linux/i386
perl Configure.pl --cc=g++|--link=g++|--ld=g++|--optimize

g++ build fails very quickly.  Here's an edited version of the tail of 
the output:

g++ -I./include -I./include/pmc  -D_GNU_SOURCE [ long list of -D and -W 
options ] -Wwrite-strings -fvisibility=hidden -Isrc/string -Isrc/ -o 
src/string/api.o -c src/string/api.c
In file included from ./include/parrot/parrot.h:242,
                  from src/string/api.c:28:
./include/parrot/hash.h:324: error: duplicate 'const'
make: *** [src/string/api.o] Error 1

g++ -I./include -I./include/pmc  -D_GNU_SOURCE -DHASATTRIBUTE_CONST 
[long list -f -D and -W options] -Wwrite-strings -fvisibility=hidden 
-Isrc/string -Isrc/ -o src/string/api.o -c src/string/api.c
In file included from ./include/parrot/parrot.h:242,
                  from src/string/api.c:28:
./include/parrot/hash.h:324: error: duplicate 'const'
make: *** [src/string/api.o] Error 1

This part of .src/hash.c seems suspect:

  236 =item C<size_t Parrot_hash_pointer(const void const *p, size_t 
hashval)>
  237
  238 A (weak) perfect hash over pointers.
  239
  240 =cut
  241
  242 */
  243
  244 PARROT_WARN_UNUSED_RESULT
  245 PARROT_PURE_FUNCTION
  246 size_t
  247 Parrot_hash_pointer(ARGIN_NULLOK(const void const *p), size_t hashval)
  248 {
  249     ASSERT_ARGS(Parrot_hash_pointer)
  250     size_t x = (size_t)p;
  251     hashval ^= x;

Why the 'const void const *p' at line 247?  gcc let this pass, but g++ 
did not.

plobsing, can you take a look?

Thank you very much.
Jim Keenan



More information about the parrot-dev mailing list