Lim Hock-Chai wrote:
Thanks Barbara. I simplified my function to make it easier for me to
ask the question. The actual function prototype looks like below:

typedef char *logECD_STP3_piModuleName_T;

Ok, say you have this:

void fn(char *p);
typedef char *MyType;

void myFn()
{
MyType s;

fn( (char *) s;
}

Since MyType is actually char *, then the cast is _currently_ correct. But what if someone changes MyType to be say one of your varying-length structs? Now you are casting a varying-struct pointer to a char pointer. The compiler will be happy, but your code will not work.


This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].