James Carlson <james.d.carlson at sun.com> wrote:
> > Are you able to change or fix stdio on AIX?
>
> No. But I don't work on AIX, and AIX isn't open.
But many portable applicatons work on e.g. AIX and they need to
deal with other platforms.
> Solaris *is* open and I *do* work on Solaris. You're also able to
> change Solaris as you may need. That, to me, is a big difference.
>
> (Funny you should mention AIX, as that was a platform I used to use
> years ago, and the libschily implementation of printf didn't work
> there due to, as I recall, floating point implementation problems.
This was most likely 10 years ago.
Printing floats now work on any platform and it does since a long time.
> Ripping it out [and the handful of strange '%r' recursion things] and
> using the regular libc fixed the problems. This was a good instance
> of when having a reimplementation was more pain rather than less.)
If you rip out my printf, many things may work but many other things won't.
The %r format allows to easly write layered (higher level) versions of
any function that uses printf and varargs. If you remove my printf from
my code, it may not be immediately visible that something did break but I
would guess that it breaks more places than it would if you ar just unable to
print floats.
If you like to understand why replacing code from libc may help porting,
let us talk about printing long long ints which is very important in case you
e.g. don't know the size of an uid_t or similar.
Long before C99 did give us (but currently only on a few platforms)
the %j printf format character, I did implement something similar:
My %lld was really a maxint_t and the related type (Llong) was a long long
on platforms that support long long but long on other plaforms.
Do you know how much code would be affected if this feature of my printf()
was missing?
> > You are loking from the wrong point of view.
> >
> > ksh is not a Solaris only application.
>
> I understand that. But when something integrates into Solaris, we
> have a responsibility to see to it that it does so in a way that's
> compatible with the rest of the system.
Requiring it to be compatible does not mean that own additions for portability
reasons need to be removed.
J?rg
--
EMail:joerg at schily.isdn.cs.tu-berlin.de (home) J?rg Schilling D-13353 Berlin
js at cs.tu-berlin.de (uni)
schilling at fokus.fraunhofer.de (work) Blog:
http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily