asctime.c

Robert Elz kre at munnari.OZ.AU
Wed Jul 28 08:30:04 UTC 2004


    Date:        Wed, 28 Jul 2004 05:54:42 +0100
    From:        "Clive D.W. Feather" <clive at demon.net>
    Message-ID:  <20040728045442.GC71827 at finch-staff-1.thus.net>

  | > This one isn't just of academic interest, there's lots of code that
  | > does stuff like
  | > 
  | > 	printf("The date is: %.24s today\n", asctime(tm));
  | > 
  | > and expects that there cannot be a newline between the date and the
  | > word "today".
  | 
  | Then that code is broken. End of story.

Nonsense (for this point anyway - ignore the possibility that asctime()
might return NULL, that could be tested before the value is used).

The standard should be documenting C as it exists, not reinventing it.
The standard (any standard) has meaning only as long as it is actually
implemented, if it is ignored, it is just so much worthless paper (or bits).

Implementors must (both economically, and morally) keep on implementing
what existing code uses, otherwise no-one will care about, or use,
their implementation, the users will just find something that does what
they expect.

Here, the tzlib library is the implementation, and it needs to keep supporting
all the old code that was written way back before anyone even thought about
having a standard for C, using this perfectly well specified, and
consistently implemented, interface.

If the standard chooses to stick its head in the mud and ignore what the
written code actually does, it is our responsibility to make sure the
standard gets ignored.

kre




More information about the tz mailing list