-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
function without prototype warnings #38
Comments
It is just a warning, you can ignore it, or configure CFLAGS with something like |
And I see that there is already |
Changed to c99 in 4d5d46a, can you check with the latest code? |
I just tried this out and it doesn't fix it. |
…arnings to suppress warnings that library users are unlikely to fix or address.
…t emit warnings to suppress warnings that library users are unlikely to fix or address." This reverts commit e3672cc.
Fixes #38 - added CGO_CFLAGS to specific targets that emit w…
@gen2brain We might need to back that change out. Apparently, it works fine on M1/2 Macs, but it can cause build errors on the x86 Macs. |
These were just warnings, not build errors. So now it warns that such suppression options do not exist. I do not see how that is related to M1/2 (i.e. architecture), it should be associated with the Clang version, no? |
You're right, the issue at hand is linked to the Clang version. To address this in my team project, I created a script in the Makefile that checks if the flags are supported before exporting them. However, I'm unsure if the same can be done for the cgo flags within the package. CLANG_EXISTS := $(shell command -v clang 2> /dev/null)
FLAG_SUPPORTED := $(shell echo 'int main(){}' | clang -x c - -o /dev/null -Wno-typedef-redefinition -Wno-deprecated-non-prototype 2>&1 && echo YES)
ifdef CLANG_EXISTS
ifeq ($(FLAG_SUPPORTED),YES)
export CGO_CFLAGS := -Wno-typedef-redefinition -Wno-deprecated-non-prototype
endif
endif
all:
@echo $(CGO_CFLAGS) I was concerned about the potential negative impact this could have on people currently. |
Something like this should be possible, with predefined macros, if you can tell me the exact major versions that need to be checked.
|
This should be fixed now, with the Zlib update. |
When compiling with newest apple clang (14.0.3) I now get the warning :
warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
on zlib/adler32.c, zlib/crc32.c, zlib/inffast.c, zlib/inflate.c, zlib/inftrees.c, zlib/zutil.c.
My guess is the embedded zlib will need .h files in the near future? , but I am no C expert...
The text was updated successfully, but these errors were encountered: