-
Notifications
You must be signed in to change notification settings - Fork 111
error: cannot initialize a variable of type 'const char *const' with an rvalue of type 'int' #164
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
Comments
Hmm, that's strange, because I have a preprocessor branch that is attempting to select the right variant: corrade/src/Corrade/Utility/Implementation/ErrorString.cpp Lines 63 to 69 in 3bf6057
Man pages tell me that So, given that I already have to check for Apple and Emscripten explicitly anyway, should I check for BSD this way as well? I.e., would the following work? Is diff --git a/src/Corrade/Utility/Implementation/ErrorString.cpp b/src/Corrade/Utility/Implementation/ErrorString.cpp
index 675a6a9e3..66743901f 100644
--- a/src/Corrade/Utility/Implementation/ErrorString.cpp
+++ b/src/Corrade/Utility/Implementation/ErrorString.cpp
@@ -60,7 +60,7 @@ void printErrnoErrorString(Debug& debug, const int error) {
idea. The POSIX variant returns int(0) on success, while the GNU variant
may return a pointer to a statically allocated string instead of filling
the buffer. Sigh. */
- #if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE)
+ #if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE) || defined(BSD)
char string[256];
CORRADE_INTERNAL_ASSERT_OUTPUT(strerror_r(error, string, Containers::arraySize(string)) == 0);
#else Thanks in advance for testing this patch! |
The patch doesn't work, but it works when I just verified - no generic BSD define is present in the C++ compiler on FreeBSD:
Only the |
Ah, that's a bit sad. I added all three in 8effd9c. Thanks for reporting this, and thanks for maintaining the Corrade/Magnum packages as well :) |
rev. 2020.06-1214-g3bf6057d
clang-14
FreeBSD 13.1
The text was updated successfully, but these errors were encountered: