• 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: warning at nslog
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: warning at nslog


  • Subject: Re: warning at nslog
  • From: Matt Neuburg <email@hidden>
  • Date: Sun, 27 Sep 2009 18:26:35 -0700
  • Thread-topic: warning at nslog

On Sun, 27 Sep 2009 12:29:01 -0400, Sherm Pendley <email@hidden>
said:
>On Sun, Sep 27, 2009 at 12:12 PM, Jos Timanta Tarigan
><email@hidden> wrote:
>
>> Format not a string literal and no format arguments.

>Omitting the format string is an anti-pattern that's been common for a
>long time in C, with many functions such as printf() that also take a
>format string argument. Think about what happens at run time if your
>path string happens to contain a format specifier such as %s.
>
>One should always - yes, ALWAYS - use a format string, even when it
>adds nothing to the output:

I agree, and I'm happy that this warning is now given. Also, note that the
common pattern:

 NSLog(@"%@", something);

is easily entered using the Objective Development completion dictionary (as
are many other NSLog patterns).

 http://www.obdev.at/products/completion-dictionary/index.html

Just one of the many reasons I can't live without it! m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: warning at nslog
      • From: "Sean McBride" <email@hidden>
  • Prev by Date: C++: std::ostringstream default ctor problems
  • Next by Date: Dual project roots
  • Previous by thread: Re: warning at nslog
  • Next by thread: Re: warning at nslog
  • Index(es):
    • Date
    • Thread