This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: redefinition of `cyg_uint32'
- From: Jürgen Lambrecht <Jurgen dot Lambrecht at tiscali dot be>
- To: Andrew Lunn <andrew at lunn dot ch>
- Cc: eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Thu, 18 May 2006 16:43:21 +0200
- Subject: Re: [ECOS] redefinition of `cyg_uint32'
- References: <446B3B59.70801@televic.com> <20060517155527.GL14082@lunn.ch>
I'm sorry, I confused #define with typedef.
This is the correct problem description:
The problem started by using the openbsd package.
In ecos/packages/net/bsd_tcpip/current/include/sys/bsdtypes.h:
typedef unsigned int u_int32_t;
typedef unsigned int uint32_t;
But in ecos/packages/compat/linux/current/include/linux/types.h:
#define uint32_t cyg_uint32
So apparantly, the compiler replaces in bsdtypes.h the 'uint32_t' with
cyg_uint32, which becomes then redefined.
Apparantly, because it is not possible because the same file bdstypes.h
contains also:
#undef uint32_t
The compiler complains when compiling jffs2:
arm-elf-gcc -c ... ecos/packages/fs/jffs2/current/src/compr.c
And compr.h contains
#include <linux/types.h>
What happens when a typedefed "uint32_t" exists, follewed by #define'ing it??
Could that be the cause of problems?
Kind regards,
Juergen
Andrew Lunn wrote:
On Wed, May 17, 2006 at 05:03:53PM +0200, Juergen Lambrecht wrote:
Hello,
I get compiler errors for all `cyg_uintxxx' types, e.g.
redefinition of `cyg_uint32'
This is because the build directory
ecos_ims/install/include/linux/types.h contains the following wrong code:
#include "cyg/infra/cyg_type.h"
#define uint8_t cyg_uint8
#define uint16_t cyg_uint16
#define uint32_t cyg_uint32
#define int8_t cyg_int8
#define int16_t cyg_int16
#define int32_t cyg_int32
The types above are redefined because "cyg/infra/cyg_type.h" already
defines them (ecos/packages/infra/current/include/cyg_type.h
cyg_types.h only defines the cyg_* types. It does not define the onces
without cyg_ . Hence why the linux/types.h exists.
However i don't see how this can cause a problem. Please can you give
a real test case to reproduce the error.
Thanks
Andrew
--
Jürgen Lambrecht
Diksmuidse Heerweg 338
8200 Sint-Andries
Tel: +32 (0)50 842901
GSM: +32 (0)476 313389
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss