• 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: Ken Turkowski <email@hidden>
  • Date: Mon, 26 Apr 2004 21:38:30 -0700

On Apr 26, 2004, at 2:56 PM, Frank Midgley <email@hidden> wrote:
On Apr 26, 2004, at 4:25PM, Ricky Sharp wrote:

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?

What OS lets you use # with %s in (s)printf? A quick Google search brought back only printf man pages that say that # has no effect on %s. What alternate form could a string have?

Pascal strings are length prefixed.

--
Ken Turkowski                    email@hidden
Engineer/Scientist   http://www.worldserver.com/turk/
Independent Consultant      Industrial Grade Software
Computer Graphics     2D     3D     Immersive Imagery
Photo-mosaicing       Panoramas       Computer Vision
Applied Mathematics  Numerical Analysis  Optimization
_______________________________________________
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: Chris Espinosa <email@hidden>
  • Prev by Date: Re: _GLIBCXX_DEBUG
  • Next by Date: XCode 1.2 Release Notes incorrect re: agvtool?
  • Previous by thread: Re: # flag used with printf warning
  • Next by thread: Re: # flag used with printf warning
  • Index(es):
    • Date
    • Thread