On Mon, 2007-06-11 at 20:59 +0100, Pedro Alves wrote:
> Danny Backx wrote:
> > Functions like swprintf are in coredll.dll, and should be described in
> > stdlib.h, says http://msdn2.microsoft.com/en-us/library/ms860374.aspx .
[..]
> > Shouldn't we add these functions to src/w32api/include/stdlib.h ?
[..]
> This could be problematic.  Eg:  sprintf from newlib accepts a few
> c99 formatters, while coredll doesn't, which means you would get a discrepancy
> between the sprintf/swprintf.  E.g.:  %lld.
> Another problem, that would be more serious, is, the stdio implementation from
> newlib isn't compatible with the coredll version.  That is, calling fwprintf
> on a FILE* opened by fopen would probably crash.  I don't know if newlib
> supports wide versions of the stdio functions.  If it does, we could use those
> instead.

You're right in mentioning that the fwprintf type functions should not
be used from cegcc, because their notion of FILE * comes from coredll
and is incompatible with newlib.

I knew that but failed to notice it when I sent this message.

However, there are quite a few other functions that don't have this
problem. Examples are (obviously swprintf), swscanf, wcstod, wcstol,
wcscat, wcschr, wcslen, .. . Again, see <tchar.h> .

A problem I see when inspecting this list is that e.g. wcstol isn't in
our cegcc.dll but wcslen is. Inconsistet.

My suggestion :
- Document why we don't have e.g. swprintf in the cegcc universe's
  include files
- After the next release, try to figure out what to do about
  inconsistencies like the ones I just found.

> When you use cegcc, you are programming on an abstraction on top of coredll.
> The original newlib usage came from a need to develop console/server apps,
> usually ports of unix software.  I really recommend to switch to mingw32ce
> for new apps and ports.

The "and ports" part of this sentence is probably very good advice, but
sometimes very (too ?) hard to accomplish.

        Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info

Attachment: signature.asc
Description: This is a digitally signed message part

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to