-
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
Redefinition of functions with MBEDTLS_PLATFORM_MEMORY and MBEDTLS_PLATFORM_CALLOC_MACRO #1706
Comments
Offhand, I'm not sure the design is supposed to accommodate this configuration. However - we'll look into it, and maybe it needs better documentation or more checks, if it isn't broken as it first appears. Thanks for the feedback! |
In fact, we are using the memory pool. {{{ #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) #include "../../../pro/pro_util/pro_a.h" void* void #define MBEDTLS_PLATFORM_CALLOC_MACRO ProCalloc // from a pool ... }}} |
ARM Internal Ref: IOTSSL-2358 |
from a brief look, this seems like a duplicate of #1642 |
Closing as a duplicate of #882. |
Description
Bug
OS
windows xp sp3, ubuntu
mbed TLS build:
Version : mbedtls-2.9.0-apache.tgz
Compiler: vs2010, gcc4.9
{{{
There is a compile error,
package : mbedtls-2.9.0-apache.tgz
file : platform.c
line : 40
condition : enable MBEDTLS_PLATFORM_MEMORY, MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO in config.h
current code:
#if defined(MBEDTLS_PLATFORM_MEMORY)
fixed code:
#if defined(MBEDTLS_PLATFORM_MEMORY) &&
(!defined(MBEDTLS_PLATFORM_CALLOC_MACRO) || !defined(MBEDTLS_PLATFORM_FREE_MACRO))
below is output snapshot in vs2010:
------ Build started: Project: mbedTLS, Configuration: Debug Win32 ------
platform.c
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(61): error C2365: 'calloc' : redefinition; previous definition was 'function'
c:\program files\microsoft visual studio 10.0\vc\include\stdlib.h(598) : see declaration of 'calloc'
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(62): error C2365: 'free' : redefinition; previous definition was 'function'
c:\program files\microsoft visual studio 10.0\vc\include\stdlib.h(599) : see declaration of 'free'
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(67): error C2106: '=' : left operand must be l-value
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(67): warning C4550: expression evaluates to a function which is missing an argument list
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(68): error C2106: '=' : left operand must be l-value
e:\work\gitroot\libpro\src\mbedtls\library\platform.c(68): warning C4550: expression evaluates to a function which is missing an argument list
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Eric Tung, dhhome2006@gmail.com
}}}
The text was updated successfully, but these errors were encountered: