Error in <string.h>: Typedef redefinition with different typ

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
droll
Posts: 46
Joined: 20 Dec 2013 01:37

Error in <string.h>: Typedef redefinition with different typ

Post by droll » 18 Dec 2016 12:10

The include file 'string.h' that is provided with the Z-Uno (version 2.0.6 and 2.0.7) contains the following type definition:

Code: Select all

typedef unsigned int size_t;
After including <string.h> into my program the compilation generates the following error:

Code: Select all

error:typedef redefinition with different types ('unsigned int' vs 'unsigned short')
Since my program is not defining the size_t type I guess this type is defined by default by the compiler, and string.h is redefining it differently.
So the string.h include file that is provided with the Z-Uno package seems be incompatible with the compiler.

droll
Posts: 46
Joined: 20 Dec 2013 01:37

Re: Error in <string.h>: Typedef redefinition with different

Post by droll » 18 Dec 2016 12:24

Well, I found the second place where size_t is defined:

File 'ArduinoTypes.h':

Code: Select all

typedef unsigned short size_t;
File 'string.h':

Code: Select all

typedef unsigned int size_t;

p0lyg0n1
Posts: 172
Joined: 04 Aug 2016 07:14

Re: Error in <string.h>: Typedef redefinition with different

Post by p0lyg0n1 » 18 Dec 2016 19:19

Hi,
We didn't use string.h in our projects yet. You can try to add string.h to your code and replace our defenition of size_t to its definition in string.h.

Post Reply