Re: # flag used with printf warning
Re: # flag used with printf warning
- Subject: Re: # flag used with printf warning
- From: Ricky Sharp <email@hidden>
- Date: Mon, 26 Apr 2004 18:02:53 -0500
On Apr 26, 2004, at 4:52 PM, Jens Miltner wrote:
Am 26.04.2004 um 23:25 schrieb Ricky Sharp:
I have several sprintf statments in the form:
sprintf( someNullTerminatedString, "some message %#s",
someLengthPrefixedString );
I get the following warning when compiling (this is a Carbon app):
'#' flag used with '%s' printf format
Is this just a warning that the code is less portable? Or, is it the
case where this is deprecated and should be avoided?
The "%#s" format specifier is a Metrowerks specific extension to the
printf format (actually, I think MPW might have supported it as well),
so I'd expect it to either not work when used with the BSD standard C
lib, or it might just stop working without further notice...
Did you try whether it works in the BSD libs? Even if it does today,
just don't rely on it to work in future releases...
Coming from a MetroWerks project is why the code is using that. I also
had thought it was a MetroWerk's specific thing, but it works a-ok in
my mach-o Carbon app that links against libstdc++.a as well as a
Standard Tool app.
It's easy enough to replace; was just curious about the severity of the
warning.
Thanks,
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Founder & President
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.