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