04-14-2009 04:00 AM
04-14-2009 02:27 PM
The crash you found is a bug. It is related to runtime pointer checking support for the array. It occurs when you have an array of structures, and you use designated initializers to initialize a struct member, followed by an designator for the enclosing array (i.e. { [2].a=345, [0].b=8.97 }) Unfortunately there is no workaround besides disabling the runtime pointer checking (from Options>>Build Options, set Debugging level to "No run-time checking" ). I've filed a bug report to have this fixed in a future release.
Though the inline keyword will not result in any actual function inlining, it is supported semantically. It results in something very similar to a static declaration. This is provided for the sake of using existing header files that declare inline functions.
A function with a variable number of arguments must have some way of knowing the number and types of the arguments that will be passed. For example, many CVI library set attribute functions (e.g. SetCtrlAttribute) take a variable argument list and use the passed attribute specifier to determine how many and what types of arguments to expect. Your function could take parameters to specify the number/types of variable arguments, or in some cases you can use a special reserved value to indicate the end of the parameter list. For example:
MakeStringList("hello", "world", 0);
MakeStringLIst("little", "bunny", "foo", "foo", 0);
In this case, because 0 is not a valid string value, it can be used to indicate the end of the list. The function MakeStringList would keep reading char * arguments until it read one that was equal to 0.
Mert A.
National Instruments