02-14-2007 07:13 AM
02-14-2007 07:22 AM
You are trying to move (char)s, not (char *)s. So your declarations of source and destination should be (char *), not (char **):
char* source = string + 1;
char* destination = string + 5;
and the memmove() should be:
memmove(destination, source, 3 * sizeof(char));
assuming you actually want to move 3 chars.
02-14-2007 07:26 AM
Martin,
I'm afraid that you have misunderstood. I want to move char* not char.
Also. I forgot the important version info:
CVI: 8.0.1(356)
DAQmx: 8.3.1f0
I have observed the problem under both Windows 2000 and XP
02-14-2007 09:17 AM
David,
Do you get the problem when you run a Release version of your code? I tried your simple example and reproduced the baffling behaviour (and GPF) within the CVI environment, but when I tried a standalone Release executable I did not get a GPF error. It just might be that the CVI debug environment is getting confused with this library call and is screwing up the stack somehow - I have a vague recollection that CVI debug puts all sorts of extra stuff around function calls and parameter lists.
I'm guessing that your real code is a bit more complex than the sample snippet you posted - can you tell if a release version works OK?
JR
02-14-2007 09:51 AM
JR,
I confess that I had not tried generating a release configuration. However, you are correct, the full program works under such conditions. In truth, the original post was merely aimed a NI to point out what appeared to be a compiler bug. But you appear be right to narrow it down to the debug code.
Many thanks,
Dave
P.S. I need the code to work in the debugger and hence my chosen workaround is to cast the parameters to (void *).
02-15-2007 08:41 AM
> I'm afraid that you have misunderstood. I want to move char* not char.
Whoops! Sorry!
02-15-2007 09:42 AM
Martin,
I hope that my original reply didn't seem brusque; it wasn't meant to be. I'm sure to need your assistance in the future.
Dave
02-17-2007 07:57 AM
02-22-2007 07:41 PM