Skip to content

Commit

Permalink
mbedtls: Disables type-limit error.
Browse files Browse the repository at this point in the history
Building using cmake is resulting in following error:
My gcc version is - gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
The error is -
/home/linux/mbedtls/mbedtls/programs/ssl/ssl_context_info.c: In function ‘read_next_b64_code’:
/home/linux/mbedtls/mbedtls/programs/ssl/ssl_context_info.c:384:16: error: comparison is always true due to limited range of data type [-Werror=type-limits]
384 | while( EOF != c )

This message appears as error while using cmake and as warning with make.
This error is avoided by adding -Wno-type-limits to CMakeLists.txt.

Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
  • Loading branch information
naynajain committed Jun 15, 2020
1 parent 5198909 commit 69252ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if(CMAKE_COMPILER_IS_GNU)
# note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wwrite-strings")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-type-limits -Wwrite-strings")
if (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wvla")
endif()
Expand Down

0 comments on commit 69252ab

Please sign in to comment.