Missing braces in Updates.h macro
Donald Bruce Stewart
dons at cse.unsw.edu.au
Wed Sep 1 21:51:22 EDT 2004
Hey,
As you might have seen, last night's head on OpenBSD failed with:
../../ghc/compiler/ghc-inplace -optc-O -optc-Wall -optc-W -optc-Wstrict-prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations -optc-Winline -optc-Waggregate-return -optc-Wbad-function-cast -optc-I../includes -optc-I. -optc-Iparallel -optc-DCOMPILING_RTS -optc-fomit-frame-pointer -H16m -O -O2 -static -#include Prelude.h -#include Rts.h -#include RtsFlags.h -#include RtsUtils.h -#include StgRun.h -#include Schedule.h -#include Printer.h -#include Sanity.h -#include Storage.h -#include SchedAPI.h -#include Timer.h -#include Itimer.h -#include ProfHeap.h -#include LdvProfile.h -#include Profiling.h -#include Apply.h -fvia-C -dcmm-lint -c Interpreter.c -o Interpreter.o
Interpreter.c: In function `interpretBCO':
Interpreter.c:405: syntax error before `const'
Interpreter.c:405: `info' undeclared (first use in this function)
Interpreter.c:405: (Each undeclared identifier is reported only once
Interpreter.c:405: for each function it appears in.)
gmake: *** [Interpreter.o] Error 1
I tracked this down, and it looks like it is barfing on the occurence of
DECLARE_IPTR(info) in UPD_REAL_IND. A similar situation occurs in
Schedule.c:3218: "syntax error before `const'". Looks like it is because
of the decl not appearing at the start of a block.
It is still a bit mysterious -- as the head is building fine on linux
each night. Any gcc hackers know why this could be? I'm using 2.95.3
here.
The following patch makes these cases compile.
-- Don
------------------------------------------------------------------------
--- Updates.h.orig Thu Sep 2 11:25:31 2004
+++ Updates.h Thu Sep 2 11:25:36 2004
@@ -57,13 +57,15 @@
if you *really* need an IND use UPD_REAL_IND
*/
#define UPD_REAL_IND(updclosure, ind_info, heapptr, and_then) \
+ { \
DECLARE_IPTR(info); \
info = GET_INFO(updclosure); \
AWAKEN_BQ(info,updclosure); \
updateWithIndirection(GET_INFO(updclosure), ind_info, \
updclosure, \
heapptr, \
- and_then);
+ and_then); \
+ }
#if defined(PROFILING) || defined(TICKY_TICKY)
#define UPD_PERM_IND(updclosure, heapptr) \
More information about the Cvs-ghc
mailing list