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

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


  • Subject: Re: gcc poison, how to catch use of strcpy()?
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 19 May 2009 11:27:04 -0700

On Tue, May 19, 2009 at 10:04 AM, Sean McBride <email@hidden> wrote:
> On 5/19/09 10:01 AM, Shawn Erickson said:
>
>>> Ever wished Apple would deprecate things so that you'd be warned against using them?
>>
>>/*
>> * only certain compilers support __attribute__((deprecated))
>> */
>>#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) &&
>>(__GNUC_MINOR__ >= 1)))
>>    #define DEPRECATED_ATTRIBUTE __attribute__((deprecated))
>>#else
>>    #define DEPRECATED_ATTRIBUTE
>>#endif
>
> Is your suggestion to hack the system headers to add the deprecated
> decoration?  I guess that would work.

No not really was just pointing out that Apple does mark things
deprecated (and how they do it) since you implied they don't by your
limited statement. If folks find things that should be marked
deprecated file defects about it so the next rev. of the SDK gets
improved. With that said I think current GCC fails to note methods
flag deprecate in Objective-C in a few cases (class methods IIRC).

Of course I am not sure Apple would mark standard C API as deprecated
based on security concerns (unless they really are being removed)...
so the poison pragma is nice things to try.

Also consider using nm on a compiled binary to list external symbols,
etc. and run that thru some regex to pick out API that you want to
avoid.

/me hopes the static analyzer in clang would pickup these types of
basic checks (if it doesn't already do it)

-Shawn
 _______________________________________________
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: "Sean McBride" <email@hidden>
References: 
 >gcc poison, how to catch use of strcpy()? (From: "Sean McBride" <email@hidden>)
 >Re: gcc poison, how to catch use of strcpy()? (From: Shawn Erickson <email@hidden>)
 >Re: gcc poison, how to catch use of strcpy()? (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Xcode, SCM and External Editors - Not picking up changes?
  • Next by Date: iPhone OS Filessytem
  • Previous by thread: Re: gcc poison, how to catch use of strcpy()?
  • Next by thread: Re: gcc poison, how to catch use of strcpy()?
  • Index(es):
    • Date
    • Thread