-
Notifications
You must be signed in to change notification settings - Fork 906
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
fix: build with gcc 13 with enum and int mismatch #6184
Merged
rustyrussell
merged 1 commit into
ElementsProject:master
from
vincenzopalazzo:macros/gcc13-build
Apr 26, 2023
Merged
fix: build with gcc 13 with enum and int mismatch #6184
rustyrussell
merged 1 commit into
ElementsProject:master
from
vincenzopalazzo:macros/gcc13-build
Apr 26, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vincenzopalazzo
force-pushed
the
macros/gcc13-build
branch
from
April 16, 2023 15:41
158bdd5
to
ae9b3eb
Compare
Thanks. Looks like it builds now:
|
rustyrussell
approved these changes
Apr 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack ae9b3eb
Needs |
gcc 13 add an extra check for the enum in the definition of a method. In our case the code was failing with the following error, and the compiler is right, our definition is different from the implementation. ``` $ make CC: cc -DBINTOPKGLIBEXECDIR="../libexec/c-lightning" -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition -Werror -Wno-maybe-uninitialized -Wshadow=local -std=gnu11 -g -fstack-protector-strong -Og -I ccan -I external/libwally-core/include/ -I external/libwally-core/src/secp256k1/include/ -I external/jsmn/ -I external/libbacktrace/ -I external/gheap/ -I external/x86_64-redhat-linux/libbacktrace-build -I external/libsodium/src/libsodium/include -I external/libsodium/src/libsodium/include/sodium -I external/x86_64-redhat-linux/libsodium-build/src/libsodium/include -I . -I/usr/local/include -DSHACHAIN_BITS=48 -DJSMN_PARENT_LINKS -DCOMPAT_V052=1 -DCOMPAT_V060=1 -DCOMPAT_V061=1 -DCOMPAT_V062=1 -DCOMPAT_V070=1 -DCOMPAT_V072=1 -DCOMPAT_V073=1 -DCOMPAT_V080=1 -DCOMPAT_V081=1 -DCOMPAT_V082=1 -DCOMPAT_V090=1 -DCOMPAT_V0100=1 -DCOMPAT_V0121=1 -DBUILD_ELEMENTS=1 -c -o LD: cc -Og config.vars -Lexternal/x86_64-redhat-linux -lwallycore -lsecp256k1 -ljsmn -lbacktrace -lsodium -L/usr/local/include -lm -lgmp -lsqlite3 -lz -o cc plugins/spender/multifundchannel.c plugins/spender/multifundchannel.c:71:6: error: conflicting types for ‘fail_destination_msg’ due to enum/integer mismatch; have ‘void(struct multifundchannel_destination *, enum jsonrpc_errcode, const char *)’ [-Werror=enum-int-mismatch] 71 | void fail_destination_msg(struct multifundchannel_destination *dest, | ^~~~~~~~~~~~~~~~~~~~ In file included from plugins/spender/multifundchannel.c:13: ./plugins/spender/multifundchannel.h:263:6: note: previous declaration of ‘fail_destination_msg’ with type ‘void(struct multifundchannel_destination *, int, const char *)’ 263 | void fail_destination_msg(struct multifundchannel_destination *dest, | ^~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make: *** [Makefile:307: plugins/spender/multifundchannel.o] Error 1 ``` The gcc 13 is not released yet, but fedora beta is out for public testing, so it is useful fix this error in this release candidate cycle. Changelog-Fixed: Build: Compilation with upcoming gcc 13 Reported-by: @grubles Link: ElementsProject#6175 Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
force-pushed
the
macros/gcc13-build
branch
from
April 25, 2023 07:31
ae9b3eb
to
cd6aaed
Compare
Done @rustyrussell |
ACK cd6aaed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gcc 13 add an extra check for the enum in the definition of a method. In our case, the code was failing with the following error, and the compiler is right, our definition is different from the implementation.
The gcc 13 is not released yet, but fedora beta is out for public testing, so it is useful fix this error in this release candidate cycle.
Reported-by: @grubles
Fixes #6175