• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: # flag used with printf warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: # flag used with printf warning


  • Subject: Re: # flag used with printf warning
  • From: Jens Miltner <email@hidden>
  • Date: Mon, 26 Apr 2004 23:52:40 +0200

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...


</jum>
_______________________________________________
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.


  • Follow-Ups:
    • Re: # flag used with printf warning
      • From: Ricky Sharp <email@hidden>
References: 
 ># flag used with printf warning (From: Ricky Sharp <email@hidden>)

  • Prev by Date: Re: # flag used with printf warning
  • Next by Date: Re: [Solved-kinda]: Is it me or XCode 1.2?
  • Previous by thread: Re: # flag used with printf warning
  • Next by thread: Re: # flag used with printf warning
  • Index(es):
    • Date
    • Thread