I accidentally had a strategy with one term arg called without any.
In one case strc complains, in one other it doesn’t and gcc then warns:
—————–
module wrong-arity
imports term-io options
strategies
main = !1
; callit

callit(|f) =
debug
—————–

results in:
[adam@freshwater misc]$ strc -i wrong-arity.str
compiling wrong-arity.str
front-end succeeded: user 7.40 system 0.22
optimization succeeded: user 0.15 system 0.13
back-end succeeded: user 0.18 system 0.07
wrong-arity.c: In function main_0_0': wrong-arity.c:108: too few arguments to functioncallit_0_1’
compilation failed (8.24 secs)

But putting the call inside another strategy (here an io-wrap)
—————–
module wrong-arity
imports term-io options
strategies
main = !1
; io-wrap(callit)

callit(|f) =
debug
—————–

results in:
[adam@freshwater misc]$ strc -i wrong-arity.str
compiling wrong-arity.str
front-end succeeded: user 7.62 system 0.25
optimization succeeded: user 2.44 system 0.19
back-end succeeded: user 2.77 system 0.10
wrong-arity.c: In function q_4': wrong-arity.c:2450: warning: passing arg 1 ofoutput_1_0’ from incompatible pointer type
C compilation succeeded: user 0.71 system 0.06
—–
compilation succeeded: user 13.54 system 0.60

Submitted on 20 May 2004 at 11:01

Log in to post comments