This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: include file incompatibilities...
- From: Gary Thomas <gary at chez-thomas dot org>
- To: Andrew Lunn <andrew dot lunn at ascom dot ch>
- Cc: eCos Disuss <ecos-discuss at sources dot redhat dot com>
- Date: 07 Jun 2002 11:28:42 -0600
- Subject: Re: [ECOS] include file incompatibilities...
- References: <20020607163449.GG347@biferten.ma.tech.ascom.ch>
On Fri, 2002-06-07 at 10:34, Andrew Lunn wrote:
> I just found a problem compiling anoncvs for ebsa with the new_net
> template.
>
>
>
> arm-elf-gcc -c -I/export/home/lunn/ecos-work-uts/install/include -I/usr/local/pkg/plcuts/ecoscvs/packages/net/common/current -I/usr/local/pkg/plcuts/ecoscvs/packages/net/common/current/src -I/usr/local/pkg/plcuts/ecoscvs/packages/net/common/current/tests -I. -I/usr/local/pkg/plcuts/ecoscvs/packages/net/common/current/src/ -mcpu=strongarm -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef -Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections -fno-rtti -fno-exceptions -fvtable-gc -finit-priority -D_KERNEL -D__ECOS -D__INSIDE_NET -Wp,-MD,src/inet_ntop.tmp -o src/net_common_inet_ntop.o /usr/local/pkg/plcuts/ecoscvs/packages/net/common/current/src/inet_ntop.c
> In file included from /export/home/lunn/ecos-work-uts/install/include/stdio.h:74,
> from /usr/local/pkg/plcuts/ecoscvs/packages/net/common/current/src/inet_ntop.c:48:
> /export/home/lunn/ecos-work-uts/install/include/cyg/libc/stdio/stdio.h:274: `diag_printf' is an unrecognized format function type
> /export/home/lunn/ecos-work-uts/install/include/cyg/libc/stdio/stdio.h:278: `diag_printf' is an unrecognized format function type
> make: *** [src/inet_ntop.o.d] Error 1
>
What compiler is giving you these errors (version)?
> The problem is that inet_ntop.c include sys/param.h. That has
>
> // Function mapping
> #define printf diag_printf
> #define snprintf diag_snprintf
>
> later on inet_ntop.c include stdio.h, which has
>
> // Other non-ISO C functions
>
> externC int
> fnprintf( FILE * /* stream */, size_t /* length */,
> const char * /* format */, ... ) CYGBLD_ATTRIB_PRINTF_FORMAT(3, 4);
>
> externC int
> snprintf( char * /* str */, size_t /* length */, const char * /* format */,
> ... ) CYGBLD_ATTRIB_PRINTF_FORMAT(3, 4);
>
> Now cyg/infra/cyg_type.h defines
>
> // Teach compiler how to check format of printf-like functions
> # define CYGBLD_ATTRIB_PRINTF_FORMAT(__format__, __args__) \
> __attribute__((format (printf, __format__, __args__)))
>
> CPP is changing the printf above into a diag_print because of the
> #define in sys/param.h.
>
> Anybody have some goods on how to fix this? I don't like these
> #defines in sys/param.h.
They're there to minimize the changes from the imported stack,
so we don't have any dependencies on libc and such.
Wouldn't it just work to not include <stdio.h>?
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss