This is the mail archive of the ecos-patches@sourceware.org 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: eCos uSTL port patch for review


John Dallaway wrote:
Yes. The official uSTL tree would ideally build silently with "-Wundef"
but if that isn't going to happen then the "#define HAVE_INT64_T 0"
route seems better than making a lot of changes in the eCos version of
the uSTL sources.

A further alternative perhaps for now is to add -Wundef to CYGPKG_USTL_CFLAGS_REMOVE?


I agree. Option 1 seems best. At some point in the future, C99
vsnprintf() behaviour can become the default.

O.k., i will provide a patch.


Thank you.

Option 1 seems best to me too, although I wouldn't object to switching the default to be C99-compliant.


A last question. The uSTL eCos package contains a stdint.h file because
eCos libc does not provide one. Would you prefer to see this file in the
libc library or should it stay in uSTL package.


stdint.h is a C99 header. Adding it seems harmless to me, but to what
extent should we continue to add C99 features piecemeal to the existing
eCos C library which is based on C89? Is there a specific version of
stdint.h that would be preferable to ensure maximum compatibility?

Ideally we should add stdint.h to CYGPKG_ISOINFRA.


However some cleanup would be required to do that because all the sizes in Uwe's version at present are hard-coded to the common sizes for 32-bit architectures, which is unhelpful for what would become an important file for hardware abstraction. More use could be made of values in <limits.h>. Other values should be available to be overriden by the HALs directly from their <cyg/hal/basetype.h>. I'm not sure if stddef.h needs to be included.

But I think a better approach might be to look at the stdint.h used in newlib, which does some tricks with GCC:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/newlib/libc/include/stdint.h?rev=1&content-type=text/x-cvsweb-markup&cvsroot=src
But some changes are still required, and the "fast" types may still be able to be based on the cyg_halcount* types.


If that cleanup is not possible, then the file should remain in this package, and there should probably be a #if check on values from limits.h to check they match the fundamental type sizes, producing a #error if they do not.

I have a few other observations:

- These files have the full GPL:

./include/ustlecos.h
./include/config.h
./include/stdint.h
./src/ustlecos.cpp
./ChangeLog

which needs correcting to the ecos licence.

- The CDL description of CYGPKG_USTL says it needs the fileio package, but it isn't required by the package as a whole according to the CDL - it is only required in CYGCLS_USTL_FSTREAMS apparently.

- Requiring CYGPKG_LIBC_SIGNALS makes it incompatible with POSIX. For this (and other CYGPKG_LIBC_* requirements ideally) you should instead require the appropriate CYGINT_ISO_* interfaces from CYGPKG_ISOINFRA.

Hope this helps,

Jifl
--
eCosCentric Limited      http://www.eCosCentric.com/     The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.       Tel: +44 1223 245571
Registered in England and Wales: Reg No 4422071.
------["The best things in life aren't things."]------      Opinions==mine


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