I have a routine:

noinline proc handle_switch
(
  config:&config_type,
  control:&control_type, 
  zloopctl:&loopctl_type,
  arg:string
)
{
  C_hack::ignore(zloopctl);
  if arg == "--nostdimport" do
......

If I remove the C_hack::ignore, the routine fails with:

SYSTEM FAILURE
[cpp_instance_name] unable to find instance zloopctl<38042>[]

I think I understand this: Felix removes unused variables. I think it
can sometimes remove unused parameters too. When it does this
calls to the function are adjusted to not pass the missing parameter.

However this only works in special cases: it can't work if the function
is turned into a closure (the signature would be wrong). because of this
I think I disabled this feature: parameters are always considered used.
More precisely, a parameter is always considered used even if it isn't.

Well as you see I'm confused because this works:

noinline proc f(x:int, y:&int, z:int) { println$ x+z; }
noinline proc g(a:int,var b:int, c:int) { f (a, &b, c); }
proc aa() {
  g (1,2,3);
}
aa;


--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to