diff options
-rwxr-xr-x | src/sysync/mimedirprofile.h | 2 | ||||
-rwxr-xr-x | src/sysync_SDK/Sources/generic_types.h | 21 |
2 files changed, 22 insertions, 1 deletions
diff --git a/src/sysync/mimedirprofile.h b/src/sysync/mimedirprofile.h index f8453b5..287254d 100755 --- a/src/sysync/mimedirprofile.h +++ b/src/sysync/mimedirprofile.h @@ -241,7 +241,7 @@ public: class TPropertyDefinition : noncopyable { public: // constructor/destructor - TPropertyDefinition(const char* aName, sInt16 aNumVals, bool aMandatory, bool aShowInCTCap, bool aSuppressEmpty, uInt16 aDelayedProcessing, char aValuesep, char aAltValuesep, uInt16 aPropertyGroupID, bool aCanFilter, TMimeDirMode aModeDep, sInt16 aGroupFieldID, bool aAllowFoldAtSep); + TPropertyDefinition(const char* aName, sInt16 aNumVals, bool aMandatory, bool aShowInCTCap, bool aSuppressEmpty, uInt16 aDelayedProcessing, char aValuesep, char aAltValuesep, uInt16 aPropertyGroupID, bool aCanFilter, TMimeDirMode aModeDep, sInt16 aGroupFieldID, bool aAllowFoldAtSep) SYSYNC_NONNULL((2)); ~TPropertyDefinition(); // tools TParameterDefinition *addParam(const char *aName, bool aDefault, bool aExtendsName, bool aShowNonEmpty=false, bool aShowInCTCap=false, TMimeDirMode aModeDep=numMimeModes); diff --git a/src/sysync_SDK/Sources/generic_types.h b/src/sysync_SDK/Sources/generic_types.h index 4223e48..ac3bf67 100755 --- a/src/sysync_SDK/Sources/generic_types.h +++ b/src/sysync_SDK/Sources/generic_types.h @@ -139,6 +139,27 @@ typedef unsigned long CVersion; typedef sInt32 ssize_t; #endif +/* - function attributes, to be used only for declarations */ +#ifdef __GNUC__ +# ifdef __clang_analyzer__ +/* + * Mark one or more parameters as not allowing NULL ptr. + * Example: SYSYNC_NONNULL(1,3) - first and third parameter must not be NULL. + * + * Because this is getting added late in the SyncEvolution release cycle, + * it is only active when doing static code analysis with clang's scan-build. + * The compiler is not told about it when generating code, because the result + * might be different. + * + * TODO: enable unconditionally also for code generation. + */ +# define SYSYNC_NONNULL(_x) __attribute__((nonnull _x)) +# else +# define SYSYNC_NONNULL(_x) +# endif +#else +# define SYSYNC_NONNULL(_x) +#endif #ifdef __cplusplus } // namespace |