Re: discards qualifiers from pointer target type
Re: discards qualifiers from pointer target type
- Subject: Re: discards qualifiers from pointer target type
- From: Dan Bernstein <cocoa-dev%email@hidden>
- Date: Sat, 1 Mar 2003 21:22:29 +0200
Because NSString's cString method is defined
- (const char *)cString
and sendLCDcmd takes a char *.
-- Dan
On Saturday, March 1, 2003, at 09:10 PM, Chuck Rice wrote:
Can someone tell me why I am getting:
warning: passing arg 1 of `sendLCDcmd:'
discards qualifiers from pointer target type
mean? The warning occurs in:
//-------------------------------------------------------------------
// BackLightOn
//-------------------------------------------------------------------
- (void) BackLightOn:(int)minutes
{
char timout = minutes;
char * p = &timout;
[self sendLCDcmd:[[NSString
stringWithFormat:@"%1s%1s",BACKLIGHTON,p] cString]];
return;
}
//-------------------------------------------------------------------
sendLDCcmd is defined as:
- (void) sendLCDcmd:(char *)str;
The code runs fine, but warnings make me uncomfortable. -Chuck-
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.