ObjFW  Check-in [f12043ee28]

Overview
Comment:Only use OF_WARN_UNUSED_RESULT with Clang

GCC does not support it.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: f12043ee283d7d49b511e39cc0633f8c66e36a6fca7989c3a34b3f544822866c
User & Date: js on 2017-11-13 22:19:10
Other Links: manifest | tags
Context
2017-11-13
22:25
OFURLHandler: Fix missing return check-in: f8ccaac96d user: js tags: trunk
22:19
Only use OF_WARN_UNUSED_RESULT with Clang check-in: f12043ee28 user: js tags: trunk
21:56
Add -[OFString indexOfCharacterFromSet:] check-in: 4f2b0f0847 user: js tags: trunk
Changes

Modified src/macros.h from [4089255adf] to [58ba402fca].

209
210
211
212
213
214
215
216
217
218
219





220
221
222
223
224
225
226
209
210
211
212
213
214
215

216
217
218
219
220
221
222
223
224
225
226
227
228
229
230







-



+
+
+
+
+







#else
# define OF_UNREACHABLE abort();
#endif

#if defined(__clang__) || OF_GCC_VERSION >= 406
# define OF_SENTINEL __attribute__((__sentinel__))
# define OF_NO_RETURN __attribute__((__noreturn__))
# define OF_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
#else
# define OF_SENTINEL
# define OF_NO_RETURN
#endif

#ifdef __clang__
# define OF_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
#else
# define OF_WARN_UNUSED_RESULT
#endif

#if __has_attribute(__unavailable__)
# define OF_UNAVAILABLE __attribute__((__unavailable__))
#else
# define OF_UNAVAILABLE