Chris Tutty wrote:

From: "Robert Moynihan" <[EMAIL PROTECTED]>


(char*) s = CtlGetLabel(GetObjectPtr(ReadyButton));

... that might get rid of your error message, but might not solve the problem that you are asking about.



How on earth is this going to make any difference? Aside from the questionable approach of trying to eliminate a warning rather than fix the underlying problem, how would casting a variable
defined as char * to char * change anything.


Actually, I did make a mistake. I meant to write (Char*) instead of (char*). The docs say the prototype is...
const Char *CtlGetLabel(const ControlType *controlP)
... so I gave a try casting it exactly as the prototype and it eliminated the error message.


I didn't know WHY it worked, so, not understanding all the mysteries of compilers, I then went on to see if I could figure out what was happening. I originally thought that Char* and char* were the same, and the ONLY thing that I changed between the 6 trials was the case of the 'c' in the declaration and cast:

All 4 of these give the warning message:
   char        *s;
   s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

   Char        *s;
   s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

   char        *s;
   (char*) s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

   Char        *s;
   (Char*) s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

These 2 don't:
   char        *s;
   (Char*) s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

   Char        *s;
   (char*) s=CtlGetLabel(GetObjectPointer(DBTypeTriggerID));

This all feels very odd to me.  I wish I understood it better.

Bob.


-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to