Re: gcc poison, how to catch use of strcpy()?
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