lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-devel] possible mistake in mem.h


From: Goldschmidt Simon
Subject: RE: [lwip-devel] possible mistake in mem.h
Date: Wed, 30 Jan 2008 13:42:18 +0100

> Please look at mem.h, line 83:
>  void *mem_calloc(size_t count, size_t size);
> 
> We think that the type should be mem_size_t, not just size_t;
> 
> Under VisualC there is no problem because size_t is defined.
> However, when we ported the source to the embedded target, its
compiler complained.
> 
> typedef  u16_t size_t; solves the problem, but it's not the right way
to do it.
> Are we right?

As far as I know, the type 'size_t' is C-standard. If it is not defined
on your platform, you will have problems with the socket layer also. If
it is not defined, defining it in your port's 'cc.h' will be the right
thing to do.

'mem_size_t' can't be used here since lwIP allows using the C library's
malloc functions, which are standardized to use 'size_t'.

Simon




reply via email to

[Prev in Thread] Current Thread [Next in Thread]