The recent changes in strc do not longer let the compiler fail if there are undefined strategies, which is wrong:


module foo
strategies

main =
bar
————————

Current baseline:
————————
martin@linux:~/wc/strategoxt/stratego-libraries/lib> strc -i foo.str
[ strc | info ] Compiling ‘foo.str’
error: operator bar/(0,0) undefined
————————

Latest revision:
————————
martin@linux:~/wc/strategoxt/stratego-libraries/lib> /pkg/strategoxt-full-bootstrap/phase1/bin/strc -i foo.str
[ strc | info ] Compiling ‘foo.str’
[ strc | info ] Front-end succeeded : [user/system] = [0.29s/0.30s]
[ strc | info ] Optimization succeeded -O 2 : [user/system] = [0.00s/0.00s]
* warning (escaping-var-id): bar not declared
[ strc | info ] Back-end succeeded : [user/system] = [0.15s/0.06s]
mkdir .libs
gcc -I /pkg/strategoxt-full-bootstrap/phase1/include -I /pkg/strategoxt-full-bootstrap/phase1/include -I /home/martin/.nix-profile/include -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -c foo.c -fPIC -DPIC -o .libs/foo.o
foo.c: In function ‘main_0_0’:
foo.c:19: warning: implicit declaration of function ‘bar’
foo.c:19: warning: assignment makes pointer from integer without a cast
gcc -I /pkg/strategoxt-full-bootstrap/phase1/include -I /pkg/strategoxt-full-bootstrap/phase1/include -I /home/martin/.nix-profile/include -Wall -Wno-unused-label -Wno-unused-variable -Wno-unused-function -Wno-unused-parameter -c foo.c -o foo.o >/dev/null 2>&1
gcc .libs/foo.o -o foo /pkg/strategoxt-full-bootstrap/phase1/lib/libstratego-lib-native.so -L/home/martin/.nix-profile/lib /pkg/strategoxt-full-bootstrap/phase1/lib/libstratego-runtime.so /nix/store/926px9yik39shmsgmw4nhiyh0gvqlgl3-aterm-2.4.2/lib/libATerm.so -lm -Wl,–rpath -Wl,/pkg/strategoxt-full-bootstrap/phase1/lib -Wl,–rpath -Wl,/nix/store/926px9yik39shmsgmw4nhiyh0gvqlgl3-aterm-2.4.2/lib -Wl,–rpath -Wl,/pkg/strategoxt-full-bootstrap/phase1/lib -Wl,–rpath -Wl,/nix/store/926px9yik39shmsgmw4nhiyh0gvqlgl3-aterm-2.4.2/lib
.libs/foo.o: In function main_0_0': foo.c:(.text+0x95): undefined reference tobar’
collect2: ld returned 1 exit status
[ strc | error ] Compilation failed (1.88 secs)
—————————————

Submitted on 3 September 2006 at 00:18

On 3 September 2006 at 15:44 Jira commented:

STR-636, visser:
The first implementation of check-calls had a bug, but was also somewhat naive;
since m-transform-local-defs removes the registration of a definition
before it is transformed, checks of recursive definitions
failed. Also, the checker did not account for strategies passed as
higher-order arguments. The new definition fixes this. (Although
a proper treatment of higher-order strategy passing requires a bit
more typechecking.)

Log in to post comments