From e3672cc16946cbb23fe65610d97f1403739a6e08 Mon Sep 17 00:00:00 2001 From: Jamel Toms Date: Wed, 31 May 2023 14:15:46 -0400 Subject: [PATCH 1/3] Fixes gen2brain#38 - added CGO_CFLAGS to specific targets that emit warnings to suppress warnings that library users are unlikely to fix or address. --- unarrc/zip_parse-zip.go | 1 + unarrc/zip_uncompress-zip.go | 1 + unarrc/zip_zip.go | 1 + unarrc/zlib_adler32.go | 1 + 4 files changed, 4 insertions(+) diff --git a/unarrc/zip_parse-zip.go b/unarrc/zip_parse-zip.go index 86355c5..e624321 100644 --- a/unarrc/zip_parse-zip.go +++ b/unarrc/zip_parse-zip.go @@ -2,5 +2,6 @@ package unarrc /* #include "external/unarr/zip/parse-zip.c" +#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zip_uncompress-zip.go b/unarrc/zip_uncompress-zip.go index 54d8472..0381ff7 100644 --- a/unarrc/zip_uncompress-zip.go +++ b/unarrc/zip_uncompress-zip.go @@ -2,5 +2,6 @@ package unarrc /* #include "external/unarr/zip/uncompress-zip.c" +#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zip_zip.go b/unarrc/zip_zip.go index a2a6736..0efc800 100644 --- a/unarrc/zip_zip.go +++ b/unarrc/zip_zip.go @@ -2,5 +2,6 @@ package unarrc /* #include "external/unarr/zip/zip.c" +#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zlib_adler32.go b/unarrc/zlib_adler32.go index 08da79a..fe5ed37 100644 --- a/unarrc/zlib_adler32.go +++ b/unarrc/zlib_adler32.go @@ -2,5 +2,6 @@ package unarrc /* #include "external/zlib/adler32.c" +#cgo CFLAGS: -Wno-deprecated-non-prototype */ import "C" From ccdbdfdee355036fd120f69d2ff8ccdb35c17f96 Mon Sep 17 00:00:00 2001 From: Jamel Toms Date: Wed, 31 May 2023 22:23:16 -0400 Subject: [PATCH 2/3] Revert "Fixes gen2brain#38 - added CGO_CFLAGS to specific targets that emit warnings to suppress warnings that library users are unlikely to fix or address." This reverts commit e3672cc16946cbb23fe65610d97f1403739a6e08. --- unarrc/zip_parse-zip.go | 1 - unarrc/zip_uncompress-zip.go | 1 - unarrc/zip_zip.go | 1 - unarrc/zlib_adler32.go | 1 - 4 files changed, 4 deletions(-) diff --git a/unarrc/zip_parse-zip.go b/unarrc/zip_parse-zip.go index e624321..86355c5 100644 --- a/unarrc/zip_parse-zip.go +++ b/unarrc/zip_parse-zip.go @@ -2,6 +2,5 @@ package unarrc /* #include "external/unarr/zip/parse-zip.c" -#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zip_uncompress-zip.go b/unarrc/zip_uncompress-zip.go index 0381ff7..54d8472 100644 --- a/unarrc/zip_uncompress-zip.go +++ b/unarrc/zip_uncompress-zip.go @@ -2,6 +2,5 @@ package unarrc /* #include "external/unarr/zip/uncompress-zip.c" -#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zip_zip.go b/unarrc/zip_zip.go index 0efc800..a2a6736 100644 --- a/unarrc/zip_zip.go +++ b/unarrc/zip_zip.go @@ -2,6 +2,5 @@ package unarrc /* #include "external/unarr/zip/zip.c" -#cgo CFLAGS: -Wno-typedef-redefinition */ import "C" diff --git a/unarrc/zlib_adler32.go b/unarrc/zlib_adler32.go index fe5ed37..08da79a 100644 --- a/unarrc/zlib_adler32.go +++ b/unarrc/zlib_adler32.go @@ -2,6 +2,5 @@ package unarrc /* #include "external/zlib/adler32.c" -#cgo CFLAGS: -Wno-deprecated-non-prototype */ import "C" From 795a266f272fc919c3968ac9a4cf5b913fef7ef5 Mon Sep 17 00:00:00 2001 From: Jamel Toms Date: Wed, 31 May 2023 22:25:37 -0400 Subject: [PATCH 3/3] Fixes gen2brain#38 by using package level flags as opposed to specific includes --- unarrc/unarrc_cgo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unarrc/unarrc_cgo.go b/unarrc/unarrc_cgo.go index c0d5d1a..eb576f8 100644 --- a/unarrc/unarrc_cgo.go +++ b/unarrc/unarrc_cgo.go @@ -2,7 +2,7 @@ package unarrc /* #cgo !debug CFLAGS: -DNDEBUG -#cgo CFLAGS: -std=c99 -DHAVE_7Z -DHAVE_ZLIB -DHAVE_BZIP2 -D_7ZIP_PPMD_SUPPPORT +#cgo CFLAGS: -std=c99 -DHAVE_7Z -DHAVE_ZLIB -DHAVE_BZIP2 -D_7ZIP_PPMD_SUPPPORT -Wno-typedef-redefinition -Wno-deprecated-non-prototype #cgo CFLAGS: -Iexternal/lzma -Iexternal/zlib -Iexternal/bzip2 -Iexternal/unarr -fomit-frame-pointer #cgo amd64 arm64 arm64be loong64 mips64 mips64le ppc64 ppc64le riscv64 s390x sparc64 CFLAGS: -D_FILE_OFFSET_BITS=64 */