STR-498: Stand-alone strc does not report incorrect order of strategy argument.
Strc hides the output of the C compiler if there is no error, which is a bit of a problem, since the C compiler is currently the only way in which an incorrect order of strategy arguments is reported.
Example:
————————————–
module foo
imports list-cons
strategiesmain =
foo(ho(![]))strategies
foo(arg: (t -> t) * t -> t) =
arg(![])strategies
ho(s) =
s
————————————–
martin@linux:~> strc -i foo.str
[ strc | info ] Compiling ‘foo.str’
[ strc | info ] Front-end succeeded : [user/system] = [0.41s/0.92s]
[ strc | info ] Optimization succeeded -O 2 : [user/system] = [0.01s/0.10s]
[ strc | info ] Back-end succeeded : [user/system] = [0.19s/0.23s]
[ strc | info ] C compilation succeeded : [user/system] = [0.30s/0.14s]
[ strc | info ] Compilation succeeded : [user/system] = [0.91s/1.39s]
martin@linux:~>
————————————–Only at verbosity level 2, the output of the C compiler is reported:
————————————–
[ strc | notice ] Compiling C code
[ strc | notice ] Command: gcc -I /pkg/strategoxt/2005-12-12-16-32/include -I /pkg/strategoxt/2005-12-12-16-32/include -I /home/martin/.nix-profile/include -c foo.c -o foo.o
foo.c: In functionmain_0_0': foo.c:23: warning: passing arg 1 of
foo_1_0’ from incompatible pointer type
[ strc | notice ] Linking object code
————————————–Possible solutions:
Submitted on 1 January 2006 at 13:16
* pass -Werror the C compiler
* implement a type-checker for the order of strategies in Stratego (and base the renaming on information produced by this type checker)
Issue Log
STR-498, karltk:
The following code is valid:
main = l3(l2)
l0 = !5
l1(s0 : a -> a) = s0
l2(s1 : (a -> a) * a -> a) = s1(l0)
l3(s2 : ((a -> a) * a -> a) * a -> a) = s2(l1)
—-Replacing the last def with:
l3(s2 : ((a -> a) * a -> a) * a -> a) = s2(l1(!6))
should fail to compiler. Even if it succeeded, it should still give the result 5, but the standalone compiler will swallow this code silently, and erroneously result in the term 6.
STR-498, martin:
This issue is critical for 0.17, since errors in the order of arguments are no longer reported by the C compiler due to the changes in the compilation scheme.
STR-498, martin:
The stand-alone compiler no longer hides the output of the C compiler. Also, the C compiler does not warn about the order anymore. These order issues should be fixed in STR-497.
Log in to post comments