Disabling compilation optimization

   2256   1   1
User Avatar
Member
196 posts
Joined: July 2005
Offline
Hi,

I heard somewhere that there is a compiler option to stop the VEX compiler making shortcuts. Thinking I'd never use it………

Heres the bit of code im using:

sop
linegroup(){

int test;
int group;
string groupname;

test = import(“line”, group, 0, ptnum);

groupname = sprintf(“group%d”, group);

newgroup(groupname);

}


the compiler only runs the sprintf command once though. When I use printf instead to check if its working, it does! I'm guessing this works for printf as a special case for debugging??

Can anyone help me out?

Thanks
Henster
Henster
User Avatar
Member
196 posts
Joined: July 2005
Offline
I have not found the compiler options I mentioned but I got the code below working. So for anyone thats doesn't already know ( most probably myself when I forget in a couple of days! )


sop
linegroup(numofgroups){

int test;
int i;
int group;
string groupname;

for(i=0;i<=numofgroups;i++){

test = import(“line”, group, 0, ptnum);

if(group==i){
groupname = sprintf(“group%d”, group);
newgroup(groupname);
}
}
}

or something like that. It seems to think it can get away with the sprintf otherwise.

Henster
Henster
  • Quick Links