public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Bug/missing feature in sscanf
@ 2009-09-21 14:50 Øyvind Harboe
  2009-09-22 11:24 ` [ECOS] " Øyvind Harboe
  2009-09-22 15:12 ` [ECOS] " Bart Veer
  0 siblings, 2 replies; 4+ messages in thread
From: Øyvind Harboe @ 2009-09-21 14:50 UTC (permalink / raw)
  To: eCos Disuss

%llu is not supported and gives no warning...




	unsigned long long cval;
	sscanf ("401", "%llu", &cval);
	if (cval == 401)
	{
		diag_printf("sscanf OK\n");
	} else
	{
		diag_printf("sscanf FAIL\n");
	}


-- 
Øyvind Harboe
Embedded software and hardware consulting services
http://www.zylin.com

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Re: Bug/missing feature in sscanf
  2009-09-21 14:50 [ECOS] Bug/missing feature in sscanf Øyvind Harboe
@ 2009-09-22 11:24 ` Øyvind Harboe
  2009-09-22 15:12 ` [ECOS] " Bart Veer
  1 sibling, 0 replies; 4+ messages in thread
From: Øyvind Harboe @ 2009-09-22 11:24 UTC (permalink / raw)
  To: eCos Disuss

Turns out there was a patch on this that was never followed up on
from 2004(!!):


http://sourceware.org/ml/ecos-patches/2004-02/msg00044.html




-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Bug/missing feature in sscanf
  2009-09-21 14:50 [ECOS] Bug/missing feature in sscanf Øyvind Harboe
  2009-09-22 11:24 ` [ECOS] " Øyvind Harboe
@ 2009-09-22 15:12 ` Bart Veer
  2009-09-23  6:31   ` Øyvind Harboe
  1 sibling, 1 reply; 4+ messages in thread
From: Bart Veer @ 2009-09-22 15:12 UTC (permalink / raw)
  To: Øyvind Harboe; +Cc: ecos-discuss

>>>>> "Oyvind" == =?UTF-8?Q?=C3=98yvind Harboe?= <oyvind.harboe@zylin.com> writes:

    Oyvind> %llu is not supported and gives no warning...
    Oyvind> 	unsigned long long cval;
    Oyvind> 	sscanf ("401", "%llu", &cval);
    Oyvind> 	if (cval == 401)
    Oyvind> 	{
    Oyvind> 		diag_printf("sscanf OK\n");
    Oyvind> 	} else
    Oyvind> 	{
    Oyvind> 		diag_printf("sscanf FAIL\n");
    Oyvind> 	}

    >>>>> "Oyvind" == =?UTF-8?Q?=C3=98yvind Harboe?= <oyvind.harboe@zylin.com> writes:

    Oyvind> Turns out there was a patch on this that was never followed up on
    Oyvind> from 2004(!!):

    Oyvind> http://sourceware.org/ml/ecos-patches/2004-02/msg00044.html

Looking at the ChangeLog in language/c/libc/stdio, I see:

  2004-08-18  Fredrik Hederstierna  <fredrik@wespot.com>
  2004-08-18  Jonathan Larmour  <jifl@eCosCentric.com>

	* src/input/vfscanf.cxx (vfscanf): Add long long and long double
	support.
	* cdl/stdio.cdl (CYGFUN_LIBC_STDIO_LONGLONG): Make it a new option.

And looking at the sources I see code related to long longs in
vfscanf(). So at first glance the patch was incorporated, and jifl did
additional work on it to allow the long long support to be suppressed
via a CDL option to reduce code size. I assume you have not disabled
CYGFUN_LIBC_STDIO_LONGLONG in your configuration.

What I don't see, unfortunately, is an addition to tests/sscanf.c
(conditional on CYGFUN_LIBC_STDIO_LONGLONG, obviously) to verify that
the code actually works. Hence the relevant code may have been broken
at some point, or there may be a toolchain issue with long longs on
whatever architecture you are using.

Bart

-- 
Bart Veer                                   eCos Configuration Architect
eCosCentric Limited    The eCos experts      http://www.ecoscentric.com/
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
 >>>> Visit us at ESC-Boston  http://www.embedded.com/esc/boston <<<<
 >>>> Sep 22-23 on Stand 226  at Hynes Convention Center, Boston <<<<

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Bug/missing feature in sscanf
  2009-09-22 15:12 ` [ECOS] " Bart Veer
@ 2009-09-23  6:31   ` Øyvind Harboe
  0 siblings, 0 replies; 4+ messages in thread
From: Øyvind Harboe @ 2009-09-23  6:31 UTC (permalink / raw)
  To: Bart Veer; +Cc: ecos-discuss

Ahem... right... I didn't know about that option and I jumped to
conclusions after seeing the patch posting on the web that was
committed, but didn't have any response to it in the mailing list...

Configuration with eCos is necessarily trick: enable all
options default and you get code bloat, disable them all
by default and you have to find the missing option that
stops your app from working...

> I assume you have not disabled
> CYGFUN_LIBC_STDIO_LONGLONG in your configuration.

The inferred value was 0. I don't know why the inferred value was 0,
but the default value was 1...

Works fine now! Thanks!

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-09-23  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-21 14:50 [ECOS] Bug/missing feature in sscanf Øyvind Harboe
2009-09-22 11:24 ` [ECOS] " Øyvind Harboe
2009-09-22 15:12 ` [ECOS] " Bart Veer
2009-09-23  6:31   ` Øyvind Harboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).