about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch')
-rw-r--r--nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch b/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
new file mode 100644
index 000000000000..d23a308d68f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/swift/patches/libdispatch-fortify-fix.patch
@@ -0,0 +1,13 @@
+Nix compiles with _FORTIFY_SOURCE enabled. Fix error due to -Werror and an unused return value warning.
+
+--- swift-corelibs-libdispatch/src/internal.h	2019-04-26 09:33:38.287289099 +0200
++++ swift-corelibs-libdispatch/src/internal.h	2019-04-26 15:31:10.485334128 +0200
+@@ -1053,7 +1053,7 @@
+ #else
+ #define _dispatch_client_assert_fail(fmt, ...)  do { \
+ 		char *_msg = NULL; \
+-		asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \
++		(void)asprintf(&_msg, "%s" fmt, DISPATCH_ASSERTION_FAILED_MESSAGE, \
+ 				##__VA_ARGS__); \
+ 		_dispatch_assert_crash(_msg); \
+ 		free(_msg); \