This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: include file incompatibilities...


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]