steipete/PSTAlertController — pull request #2 by zadr (2014-11-08 22:58:12+00:00)
Title: __typeof__(()) instead of typeof() to be compatible with ISO C, add strong references to weak callbacks

I have a flag on in my project that was causing some warnings and other errors to show up in PSTAlertController:

The warnings are:

Frameworks/PSTAlertController/PSTAlertController.m:152:16: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
__weak typeof(self) weakSelf = self;
~~~~~~ ^
PSTAlertController/PSTAlertController.m:152:9: warning: '__weak' only applies to Objective-C object or block pointer types; type here is 'int' [-Wignored-attributes]
__weak typeof(self) weakSelf = self;
^

And the errors are:

PSTAlertController/PSTAlertController.m:152:23: error: a parameter list without types is only allowed in a function definition
__weak typeof(self) weakSelf = self;
^
PSTAlertController/PSTAlertController.m:152:28: error: expected ';' at end of declaration
__weak typeof(self) weakSelf = self;
^
;

So I changed things over to `__typeof__(())` instead of `typeof()`. According to GCC's docs, this is more correct for ISO C, anyways: https://gcc.gnu.org/onlinedocs/gcc/Typeof.html