-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
The build fails out of the box with GCC 4 #3631
Labels
bug
component-platform
Portability layer and build scripts
help-wanted
This issue is not being actively worked on, but PRs welcome.
Comments
gilles-peskine-arm
added
bug
component-platform
Portability layer and build scripts
labels
Sep 2, 2020
gilles-peskine-arm
added
the
help-wanted
This issue is not being actively worked on, but PRs welcome.
label
Sep 2, 2020
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Sep 3, 2020
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
Facing the same issue here when compiling for Centos 7. The quick and easiest fix is just to declare the variable outside of the diff --git a/mbedtls-2.24.0/library/ssl_msg.c b/mbedtls-2.24.0/library/ssl_msg.c
index 2ea35808..537e7609 100644
--- a/mbedtls-2.24.0/library/ssl_msg.c
+++ b/mbedtls-2.24.0/library/ssl_msg.c
@@ -1082,7 +1082,8 @@ static void mbedtls_ssl_cf_memcpy_if_eq( unsigned char *dst,
#endif
/* dst[i] = c1 != c2 ? dst[i] : src[i] */
- for( size_t i = 0; i < len; i++ )
+ size_t i;
+ for( i = 0; i < len; i++ )
dst[i] = ( dst[i] & mask ) | ( src[i] & ~mask );
}
|
@edsiper Depending on your configuration, there may be a lot to patch. Mbed TLS is written in C99, and we aren't going to move back to C89. You need to invoke the compiler in C99 mode. For GCC 4.x, this means |
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Sep 25, 2020
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Sep 25, 2020
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Oct 9, 2020
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Dec 30, 2020
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Apr 30, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Jul 27, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Aug 2, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Aug 2, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Aug 3, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
okhowang
added a commit
to okhowang/mbedtls
that referenced
this issue
Aug 9, 2021
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
daverodgman
pushed a commit
to okhowang/mbedtls
that referenced
this issue
May 11, 2022
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
daverodgman
pushed a commit
to okhowang/mbedtls
that referenced
this issue
May 11, 2022
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
daverodgman
pushed a commit
to okhowang/mbedtls
that referenced
this issue
May 11, 2022
Fixes Mbed-TLS#3631 Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
component-platform
Portability layer and build scripts
help-wanted
This issue is not being actively worked on, but PRs welcome.
Older versions of GCC (before 5.0) default to C89, and the build fails with
-Wall -Wextra -Werror
with some C99 constructs. In particular, the Travis build is failing in Mbed TLS 2.24.0 (example) intests/scripts/all.sh -k build_arm_none_eabi_gcc_arm5vte build_arm_none_eabi_gcc_m0plus
:We deliberately allow the use of most C99 features in recent versions of Mbed TLS, but not in the currently existing LTS branches (2.7 and 2.16 stick to C89).
We plan to support GCC 4.x as long as it's in a maintained RHEL version. So we should modify
CMakeLists.txt
to pass-std=c99
if the compiler is GCC (it shouldn't hurt for newer GCC). And we should either do it inMakefile
(but there we can't customize the flags per compiler version) or in theall.sh
jobs that call an older compiler.Goals, which we may want to do separately:
The text was updated successfully, but these errors were encountered: