-
Notifications
You must be signed in to change notification settings - Fork 37.8k
build: Detect if char equals int8_t #13580
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
Conversation
Just testing changes now. Performing build to see if it fixes https://github.com/bitcoin/bitcoin/issues/13576 |
Did not fix the problem...
|
The configure script generates the following as part of its output...
|
Can you provide your config.log? |
Here it is... |
I forgot to specify the error message for static_assert, would u mind to test this again? |
That works! Please update the main branch of source with this change. However, my build failed with... CXX compat/libbitcoin_util_a-glibc_sanity.o Shall I open this as a new issue? |
Checking for type char equals int8_t fixed. Opened a new build issue #13581 |
AC_MSG_CHECKING(for if type char equals int8_t) | ||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h> | ||
#include <type_traits>]], | ||
[[ static_assert(std::is_same<int8_t, char>::value, ""); ]])], |
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.
nit: may as well provide a message for the static_assert?
utACK 49d1f4c |
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.
utACK 49d1f4c
Can someone please explain why this is needed? I've been compiling bitcoin core on platforms that have char=uint8_t (such as ARM) as well as char=int8_t (such as x86) for years without needing any special define logic for this. What is different on this platform? |
Apparently ARM and x86 have |
@@ -189,7 +189,9 @@ template<typename X> const X& ReadWriteAsHelper(const X& x) { return x; } | |||
SerializationOp(s, CSerActionUnserialize()); \ | |||
} | |||
|
|||
#ifndef CHAR_EQUALS_INT8 | |||
template<typename Stream> inline void Serialize(Stream& s, char a ) { ser_writedata8(s, a); } // TODO Get rid of bare char |
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.
I like the TODO here - not sure its still the goal, certainly not in this PR, would have to carefully consider the consequences for serialization.
49d1f4c Detect if char equals int8_t (Chun Kuan Lee) Pull request description: Probably fixes #13576. I'm not able to test this. @stacepellegrino, can you test this? Tree-SHA512: b750e00e11e6b6f6341fec668ec2254cc101c8ebdd4878f320d6cb3b07cf326761146e4ceff0b6405b7e503ff64c093a8274bd524a097e2c49382dc296972c4f
49d1f4c Detect if char equals int8_t (Chun Kuan Lee) Pull request description: Probably fixes bitcoin#13576. I'm not able to test this. @stacepellegrino, can you test this? Tree-SHA512: b750e00e11e6b6f6341fec668ec2254cc101c8ebdd4878f320d6cb3b07cf326761146e4ceff0b6405b7e503ff64c093a8274bd524a097e2c49382dc296972c4f
49d1f4c Detect if char equals int8_t (Chun Kuan Lee) Pull request description: Probably fixes bitcoin#13576. I'm not able to test this. @stacepellegrino, can you test this? Tree-SHA512: b750e00e11e6b6f6341fec668ec2254cc101c8ebdd4878f320d6cb3b07cf326761146e4ceff0b6405b7e503ff64c093a8274bd524a097e2c49382dc296972c4f
49d1f4c Detect if char equals int8_t (Chun Kuan Lee) Pull request description: Probably fixes bitcoin#13576. I'm not able to test this. @stacepellegrino, can you test this? Tree-SHA512: b750e00e11e6b6f6341fec668ec2254cc101c8ebdd4878f320d6cb3b07cf326761146e4ceff0b6405b7e503ff64c093a8274bd524a097e2c49382dc296972c4f
49d1f4c Detect if char equals int8_t (Chun Kuan Lee) Pull request description: Probably fixes bitcoin#13576. I'm not able to test this. @stacepellegrino, can you test this? Tree-SHA512: b750e00e11e6b6f6341fec668ec2254cc101c8ebdd4878f320d6cb3b07cf326761146e4ceff0b6405b7e503ff64c093a8274bd524a097e2c49382dc296972c4f
Probably fixes #13576. I'm not able to test this. @stacepellegrino, can you test this?