Added some macros for use with the static analyser. Turned _reserved ivar in GSSpellServer into GS_PADDING_IVAR (no change to class layout).

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32036 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2011-02-10 12:15:09 +00:00
parent be3a8ecc45
commit 068624b659
3 changed files with 48 additions and 3 deletions

View file

@ -238,6 +238,51 @@
# endif
#endif
/* Static analyser macros: Provide annotations to help the analyser */
// TODO: Make this more sensible when GCC supports __attribute__((unused)) on
// ivars
#ifdef __clang__
# define GS_UNUSED_IVAR __attribute__((unused))
# define GS_NORETURN_METHOD __attribute__((__noreturn__))
#else
# define GS_UNUSED_IVAR
# define GS_NORETURN_METHOD
#endif
#ifndef NS_RETURNS_RETAINED
# if __has_feature(attribute_ns_returns_retained)
# define NS_RETURNS_RETAINED __attribute__((ns_returns_retained))
# else
# define NS_RETURNS_RETAINED
# endif
#endif
#ifndef NS_RETURNS_NOT_RETAINED
# if __has_feature(attribute_ns_returns_not_retained)
# define NS_RETURNS_NOT_RETAINED __attribute__((ns_returns_not_retained))
# else
# define NS_RETURNS_NOT_RETAINED
# endif
#endif
#ifndef NS_CONSUMED
# if __has_feature(attribute_ns_consumed)
# define NS_CONSUMED __attribute__((ns_consumed))
# else
# define NS_CONSUMED
# endif
#endif
#ifndef NS_CONSUMES_SELF
# if __has_feature(attribute_ns_consumes_self)
# define NS_CONSUMES_SELF __attribute__((ns_consumes_self))
# else
# define NS_CONSUMES_SELF
# endif
#endif
/* Include the appropriate header for ObjC2 blocks support if it is in use.
*
* FIXME: "OBJC2RUNTIME" is set to "1" if the runtime has

View file

@ -380,13 +380,13 @@ GS_EXPORT void _NSRemoveHandler( NSHandler *handler );
- (void) handleFailureInFunction: (NSString*)functionName
file: (NSString*)fileName
lineNumber: (NSInteger)line
description: (NSString*)format,...;
description: (NSString*)format,... GS_NORETURN_METHOD;
- (void) handleFailureInMethod: (SEL)aSelector
object: object
file: (NSString*)fileName
lineNumber: (NSInteger)line
description: (NSString*)format,...;
description: (NSString*)format,... GS_NORETURN_METHOD;
@end
extern NSString *const NSAssertionHandlerKey;

View file

@ -63,8 +63,8 @@ GS_EXPORT NSString *const NSGrammarUserDescription;
NSMutableDictionary *_userDictionaries;
NSString *_currentLanguage;
NSArray *_ignoredWords;
void *_reserved;
#endif
GS_PADDING_IVAR;
}
// Checking in Your Service