B
bacbacdinner
Can anyone explain to me why the code below generates a warning?
/////////////////////////////////////////////////////////////
typedef struct testStruct * TestStructRef;
typedef TestStructRef * TestStructRefPtr;
void func(const TestStructRefPtr data);
/* code that uses above */
const TestStructRef junk;
func(&junk); /* compiler warning about different 'const' qualifier,
here &junk is a pointer to a pointer */
//////////////////////////////////////////////////////////////
If I change it to use let say a 'char' instead of a struct I don't get
a compiler warning.
//////////////////////////////////////////////////////////////
void func2(const char ** data);
/* code that uses above */
const char * junk;
func2(&junk); /* no compiler warning, here &junk is a pointer to a
pointer */
///////////////////////////////////////////////////////////////
I'm seeing the warning with Visual Studio 2005. Sorry in advance if
it's something obvious but I'm at a loss to explain it. Any help
would be greatly appreciated.
/////////////////////////////////////////////////////////////
typedef struct testStruct * TestStructRef;
typedef TestStructRef * TestStructRefPtr;
void func(const TestStructRefPtr data);
/* code that uses above */
const TestStructRef junk;
func(&junk); /* compiler warning about different 'const' qualifier,
here &junk is a pointer to a pointer */
//////////////////////////////////////////////////////////////
If I change it to use let say a 'char' instead of a struct I don't get
a compiler warning.
//////////////////////////////////////////////////////////////
void func2(const char ** data);
/* code that uses above */
const char * junk;
func2(&junk); /* no compiler warning, here &junk is a pointer to a
pointer */
///////////////////////////////////////////////////////////////
I'm seeing the warning with Visual Studio 2005. Sorry in advance if
it's something obvious but I'm at a loss to explain it. Any help
would be greatly appreciated.