AFNetworking/AFNetworking — pull request #820 by tewha (2013-02-22 03:37:05+00:00)
Title: Use _Pragma instead of #pragma to disable warnings

I mentioned this in Twitter, but C99 includes _Pragma. _Pragma is like #pragma, but can be included in macros.

Thus, I've created a private header file that defines a few macros. Instead of using #pragma directly, AFNetworking includes this header and uses these macros.

There's a few advantages:

1. The worst of the #pragma ugliness is contained within a single file; the bulk of the code reads better.
2. These can be redefined as appropriate; for instance, you can remove the actual diagnostic switch in any particular macro to regain all of those warnings.

At the same time, since the new file is imported *only by the sources*, there's no need to change client code (or even include the new header in the project).

I am submitting this both for possible inclusion and also just for your enlightenment about a cool compiler feature I didn't know about (and I don't think you knew, either).