Skip to content

Commit c673c13

Browse files
committed
[Runtime] #ifdef __clang__ on printf __attribute__ in Portability.h
1 parent 4988127 commit c673c13

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

include/swift/Runtime/Portability.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ size_t _swift_strlcpy(char *dst, const char *src, size_t maxlen);
2828
#ifdef SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
2929
SWIFT_RUNTIME_ATTRIBUTE_ALWAYS_INLINE
3030
#endif
31-
__attribute((__format__(__printf__, 2, 3))) inline static int
31+
#ifdef __clang__
32+
__attribute((__format__(__printf__, 2, 3)))
33+
#endif
34+
inline static int
3235
swift_asprintf(char **strp, const char *fmt, ...) {
3336
va_list args;
3437
va_start(args, fmt);

0 commit comments

Comments
 (0)