• 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
gcc poison, how to catch use of strcpy()?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gcc poison, how to catch use of strcpy()?


  • Subject: gcc poison, how to catch use of strcpy()?
  • From: "Sean McBride" <email@hidden>
  • Date: Tue, 19 May 2009 12:55:49 -0400
  • Organization: Rogue Research Inc.

Hi all,

Perhaps this is widely known, and I've just clued in, but I've
discovered a great gcc feature that you can use to stop yourself from
using evil APIs.  Ever wished Apple would deprecate things so that you'd
be warned against using them?  Well, you can add this to your prefix header:

#pragma GCC poison NSCopyObject

Unfortunately, it doesn't work for strcpy and friends, because it warns:

warning: poisoning existing macro "strcpy"

and then errors on various system headers that use it. :(

Anyone know a way to get a warning/error when strcpy() is used?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
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: gcc poison, how to catch use of strcpy()?
      • From: Shawn Erickson <email@hidden>
  • Prev by Date: Re: warning: declaration does not declare anything
  • Next by Date: Re: gcc poison, how to catch use of strcpy()?
  • Previous by thread: ANN: Project template for dual Lite+Pro iPhone application targets
  • Next by thread: Re: gcc poison, how to catch use of strcpy()?
  • Index(es):
    • Date
    • Thread