delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/01/16/18:02:00

From: Jason Green <news AT jgreen4 DOT fsnet DOT co DOT uk>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: strftime patch
Date: Tue, 16 Jan 2001 23:01:41 +0000
Message-ID: <h8k96tcnnlq0b90tduvefu93ds6vj61m2j@4ax.com>
References: <phs26tgvhm0ir3j1fus6tl8lf6nkh7637a AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1010116115529 DOT 1793J-100000 AT is>
In-Reply-To: <Pine.SUN.3.91.1010116115529.1793J-100000@is>
X-Mailer: Forte Agent 1.7/32.534
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id SAA20553
Reply-To: djgpp-workers AT delorie DOT com

On Tue, 16 Jan 2001 11:55:59 +0200 (IST), you wrote:

> > I have not read up about locales so I am assuming that behaviour in
> > DJGPP should be according to the "C" locale.
> 
> Yes, the C locale is the only one really supported by DJGPP.

FYI, there was also a URL for some patches posted to c.o.m.d recently
to add locale support to DJGPP, in case you missed it.

>  Here's the full set of warning switches used by the library
> build; if you can compile without any warning or errors using those
> switches, you are okay.
> 
>     -Wall
>     -Wbad-function-cast
>     -Wcast-qual
>     -Werror
>     -Wmissing-declarations
>     -Wmissing-prototypes
>     -Wpointer-arith
>     -Wshadow
>     -Wstrict-prototypes
>     -Wtraditional
>     -Wwrite-strings

Compiles cleanly with all of those plus -O2.

> >        [#7]  In  the  "C" locale, the E and O modifiers are ignored
> >        and the replacement strings  for  the  following  specifiers
> >        are:
> >          %c  equivalent to ``%A %B %d %T %Y''.
> >          %p  one of ``am'' or ``pm''.
> >          %x  equivalent to ``%A %B %d %Y''.
> 
> Ouch!  This looks like a certain incompatibility with C89, where most
> implementations, including the "Standard C Library" by Plauger,
> generated a different output.

This is not established as fact yet.  It is quite possible that the
standard changed to C89 compatibility between the last public draft
and the final revision.

FWIW, the test program I gave with the patches, has exact same
behaviour on my Linux setup as with DJGPP with the first patch only.

> DJ, these format modifiers (-, _, 0, and ^) don't exist in the C
> standard, AFAICS, and aren't documented in libc.info.  Is this for
> compatibility with some other implementation?  If so, which one?

They are listed in the glibc2 info docs, but not the man page.
-- 
[please cc replies if possible]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019