This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: disabling CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF breaks sprintf()
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "Neundorf, Alexander" <Alexander dot Neundorf at jenoptik dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Wed, 13 Apr 2005 20:29:36 +0200
- Subject: Re: [ECOS] disabling CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF breaks sprintf()
- References: <5A8A17126B73AC4C83968F6C4505E3C501EF2A55@JO-EX01.JENOPTIK.NET>
On Mon, Apr 11, 2005 at 12:48:23PM +0200, Neundorf, Alexander wrote:
> Hi,
>
> if I disable both CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF and CYGSEM_LIBC_STDIO_SETVBUF_MALLOC it breaks sprintf(). Probably this is not surprisingly for people who know the code.
> sprintf() creates a Cyg_StdioStream using the user-supplied buffer for io_buf. But if CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF is disabled, it is not possible to set a different than the default static buffer for the stream, so this buffer isn't used and during runtime the application will break somewhere.
> I'd suggest to insert an assert e.g. in stream.cxx:
An assert seems like a good idea, plus a comment saying it will fire
when sprintf is used with both CYGSEM_LIBC_STDIO_DYNAMIC_SETVBUF and
CYGSEM_LIBC_STDIO_SETVBUF_MALLO disabled.
Please could you provide me a patch.
Thanks
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss