Waldek Hebisch dixit:
I have put a new gpc snapshot at:
http://www.math.uni.wroc.pl/~hebisch/gpc/gpc-20051116.tar.bz2
The weird BSD guys strike again.
I have today merged gcc-3.4-20051115 and gpc-20051116 (with both Message-ID: E1EcXkX-0004mi-00@hera.math.uni.wroc.pl and Message-ID: E1Ed6ro-00056J-00@hera.math.uni.wroc.pl applied) into our gcc branch, which also uses Hiroaki Etoh's SSP (ProPolice) stack protector, and maintains an (otherwise unsup- ported, but I might port that to gcc 4.2 or so) new platform, namely, my operating system MirOS BSD.
I have encountered a couple of errors during the build, which are shown below, as are the patches (didn't touch the RTS though because I was not sure what that warning wants to say me, instead I added -Wno-error for now). Please check my diffs against errors...
I did, though, do this (first) build with gcc-3.4-20050823 and gpc-20050217. Maybe things will solve itself later...
I will also show a testsuite run when I'm through building gcc with itself again twice.
Okay, this is not stock gcc, but maybe you're interested in success stories... especially since this might be the only gpc+ProPolice variant out there (if enabling SSP makes sense at all, don't know but I think Pascal has its own...).
Errors: | .../gcc/p/declarations.c: In function `declare_types': | .../gcc/p/declarations.c:3125: warning: suggest parentheses around && within || | .../gcc/p/declarations.c:3133: warning: suggest explicit braces to avoid ambiguous `else' | .../gcc/p/expressions.c: In function `build_range_check': | .../gcc/p/expressions.c:238: warning: unused variable `side_effects'
| In file included from .../gcc/p/gpc-lex.c:50: | <stdin>:114: warning: no previous prototype for 'yyxrealloc'
Yeah, this is generated. Probably a problem in the template. I didn't regenerate it with our lex(1).
| In file included from .../gcc/p/predef.c:31: | .../gcc/p/rts/constants.def:1:1: C++ style comments are not allowed in ISO C90 | .../gcc/p/rts/constants.def:1:1: (this will be reported only once per input file)
Handled with -std=gnu99
| .../gcc/p/predef.c: In function `build_new_dispose': | .../gcc/p/predef.c:2919: warning: 't' might be used uninitialized in this function | In file included from .../gcc/p/statements.c:33: | .../gcc/p/rts/constants.def:1:1: C++ style comments are not allowed in ISO C90 | .../gcc/p/rts/constants.def:1:1: (this will be reported only once per input file)
see above
| .../gcc/dbxout.c: In function `dbxout_type_methods': | .../gcc/dbxout.c:1011: warning: unused variable `type_encoding' | .../gcc/p/rts/string1.pas: In function `Integer2StringBaseExt': | .../gcc/p/rts/string1.pas:827: warning: Comparison always yields `False' due to limited range of data type. | .../gcc/p/rts/string1.pas:827: warning: Operand with side-effects is not evaluated. | .../gcc/p/rts/string1.pas:829: warning: Comparison always yields `False' due to limited range of data type. | .../gcc/p/rts/string1.pas:829: warning: Operand with side-effects is not evaluated.
Diff (might not apply cleanly against stock gpc): Index: dbxout.c =================================================================== RCS file: /cvs/gcc/gcc/dbxout.c,v retrieving revision 1.3 diff -u -p -r1.3 dbxout.c --- dbxout.c 20 Nov 2005 13:21:51 -0000 1.3 +++ dbxout.c 20 Nov 2005 17:47:04 -0000 @@ -1008,7 +1008,9 @@ dbxout_type_methods (tree type) { /* C++: put out the method names and their parameter lists */ tree methods = TYPE_METHODS (type); +#ifndef GPC tree type_encoding; +#endif tree fndecl; tree last; #ifndef GPC Index: p/Make-lang.in =================================================================== RCS file: /cvs/gcc/gcc/p/Make-lang.in,v retrieving revision 1.13 diff -u -p -r1.13 Make-lang.in --- p/Make-lang.in 20 Nov 2005 12:28:11 -0000 1.13 +++ p/Make-lang.in 20 Nov 2005 17:47:06 -0000 @@ -319,10 +319,10 @@ p/parse.o: $(srcdir)/p/parse.c $(P_H) $(CC) -o $@ -c $(ALL_GPC_FLAGS) $(BIG_SWITCHFLAG) $<
p/predef.o: p/predef.c $(P_H) $(RTSSRCDIR)/constants.def - $(CC) -o $@ -c $(ALL_GPC_FLAGS) $< + $(CC) -o $@ -c $(ALL_GPC_FLAGS) -std=gnu99 $<
p/statements.o: p/statements.c $(P_H) $(RTSSRCDIR)/constants.def $(RTS_VERSION_FILENAME) - $(CC) -o $@ -c $(ALL_GPC_FLAGS) -DRTS_VERSION_CHECK=""_p_GPC_RTS_VERSION_`cat $(RTSSRCDIR)/rts-version`"" $< + $(CC) -o $@ -c $(ALL_GPC_FLAGS) -std=gnu99 -DRTS_VERSION_CHECK=""_p_GPC_RTS_VERSION_`cat $(RTSSRCDIR)/rts-version`"" $<
p/typecheck.o: p/typecheck.c $(P_H) $(CC) -o $@ -c $(ALL_GPC_FLAGS) $< Index: p/declarations.c =================================================================== RCS file: /cvs/gcc/gcc/p/declarations.c,v retrieving revision 1.1.111.2 diff -u -p -r1.1.111.2 declarations.c --- p/declarations.c 20 Nov 2005 12:18:40 -0000 1.1.111.2 +++ p/declarations.c 20 Nov 2005 17:47:07 -0000 @@ -3120,9 +3120,9 @@ declare_types (void) /* Resolve forward types */ for (scan = current_type_list; scan; scan = TREE_CHAIN (scan)) if (TREE_PURPOSE (scan) && (TREE_CODE (TREE_TYPE (TREE_PURPOSE (scan))) == LANG_TYPE - || TREE_CODE (TREE_TYPE (TREE_PURPOSE (scan))) == POINTER_TYPE + || (TREE_CODE (TREE_TYPE (TREE_PURPOSE (scan))) == POINTER_TYPE && PASCAL_TYPE_CLASS (TREE_TYPE (TREE_PURPOSE (scan))) - && TREE_CODE (TREE_TYPE (TREE_TYPE (TREE_PURPOSE (scan)))) == LANG_TYPE)) + && TREE_CODE (TREE_TYPE (TREE_TYPE (TREE_PURPOSE (scan)))) == LANG_TYPE))) { tree otype = TREE_TYPE (TREE_PURPOSE (scan)); tree decl = lookup_name (TREE_VALUE (scan)), type; @@ -3130,7 +3130,7 @@ declare_types (void) if (decl && TREE_CODE (decl) == TYPE_DECL) { type = TREE_TYPE (decl); - if (is_class) + if (is_class) { if (TREE_CODE (type) == POINTER_TYPE && PASCAL_TYPE_CLASS (type)) { type = TREE_TYPE (type); @@ -3150,6 +3150,7 @@ declare_types (void) IDENTIFIER_NAME (TREE_VALUE (scan))); type = void_type_node; } + } } else if (is_class) { Index: p/expressions.c =================================================================== RCS file: /cvs/gcc/gcc/p/expressions.c,v retrieving revision 1.1.111.2 diff -u -p -r1.1.111.2 expressions.c --- p/expressions.c 20 Nov 2005 12:18:40 -0000 1.1.111.2 +++ p/expressions.c 20 Nov 2005 17:47:07 -0000 @@ -235,7 +235,7 @@ build_range_check(tree min, tree max, tr NULL_TREE), expr), expr)); return t; #else - int side_effects = TREE_SIDE_EFFECTS (expr); + int side_effects __attribute__((unused)) = TREE_SIDE_EFFECTS (expr); tree cond, tv, t; tree tmpvar = make_new_variable ("range_check", TREE_TYPE (expr)); tv = build (MODIFY_EXPR, TREE_TYPE (expr), tmpvar, expr); Index: p/pascal-lex.c =================================================================== RCS file: /cvs/gcc/gcc/p/pascal-lex.c,v retrieving revision 1.2 diff -u -p -r1.2 pascal-lex.c --- p/pascal-lex.c 20 Nov 2005 13:45:42 -0000 1.2 +++ p/pascal-lex.c 20 Nov 2005 17:47:07 -0000 @@ -635,6 +635,7 @@ yyalloc (yy_size_t size) #endif
#ifndef yyxrealloc +void *yyxrealloc (void *p, yy_size_t size); void * yyxrealloc (void *p, yy_size_t size) { Index: p/predef.c =================================================================== RCS file: /cvs/gcc/gcc/p/predef.c,v retrieving revision 1.1.111.2 diff -u -p -r1.1.111.2 predef.c --- p/predef.c 20 Nov 2005 12:18:42 -0000 1.1.111.2 +++ p/predef.c 20 Nov 2005 17:47:07 -0000 @@ -2916,7 +2916,7 @@ build_new_dispose (int r_num, tree arg1, /* Objects, the interesting case */ if (is_object) { - tree t; + tree t = NULL_TREE /* please gcc */; if (r_num == p_New) { if (PASCAL_TYPE_CLASS (TREE_TYPE (arg1))) Index: p/rts/Makefile.in =================================================================== RCS file: /cvs/gcc/gcc/p/rts/Makefile.in,v retrieving revision 1.5 diff -u -p -r1.5 Makefile.in --- p/rts/Makefile.in 20 Nov 2005 12:28:14 -0000 1.5 +++ p/rts/Makefile.in 20 Nov 2005 17:47:07 -0000 @@ -59,7 +59,7 @@ PFLAGS1=--unit-path=$(VPATH) --automake RTS_WARN=-W -Wall -Wmissing-prototypes -Wmissing-declarations RTS_CFLAGS=-I. $(RTS_WARN) $(CFLAGS) $(RTSFLAGS)# -DDEBUG RTS_PFLAGS=$(subst -Wformat,,$(RTS_CFLAGS)) $(PFLAGS) $(PFLAGS1) `cat needed-options` \ - -DRTS_RELEASE_STRING="'$(rts_version)'" -DGCC_VERSION="'$(GCC_VERSION)'" + -DRTS_RELEASE_STRING="'$(rts_version)'" -DGCC_VERSION="'$(GCC_VERSION)'" -Wno-error
PAS_SRC=rtsc.pas string1.pas error.pas heap.pas string2.pas time.pas random.pas \ fname.pas files.pas getopt.pas sets.pas math.pas endian.pas move.pas init.pas
bye, //mirabile