This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: [PATCH] itoa


On Dec  9 10:45, Jon Beniston wrote:
> Hi Corinna,
> 
> > Given that this is non-standard anyway, what about creating a safer 
> > alternative instead, along the lines of Craig's/Freddie's itoa_s/np?
> >
> > Also, shouldn't the functions start with an underscore so as not 
> > to pollute the standard namespace?  itoa and utoa are very likely 
> > not uncommon as function names in existing projects.
> 
> Perhaps. I wrote it so that some existing code would compile though. In stdlib.h, it's in a #ifndef __STRICT_ANSI__ block next to dtoa() et al., which I presume are just as non-standard. 
> 
> >> I've also modified it as per Freddie's suggestion.
> >
> > Did you test it?  AFAICS, the itoa function never returns the sign:
> 
> Oops, not Freddie's version. Updated version attached.

Thanks!  I just had a private talk with Jeff, and we came to the
conclusion that the functionality would be nice to have.  We would just
both prefer that the functions get double-underscored and the
non-underscored names are provided as macros, along the lines of

  extern char *__itoa();
  extern char *__utoa();
  #if !strict_ansi
  #define itoa __itoa
  #define utoa __utoa
  #endif

This way we keep the namespace clean and still can use the functions
inside newlib as well.

Hope that's ok.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: pgp3pRRA9tusc.pgp
Description: PGP signature


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