public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Danny Smith" <dansmister@gmail.com>
To: "Kai Tietz" <Kai.Tietz@onevision.com>
Cc: "GCC Patches" <gcc-patches@gcc.gnu.org>,
	ktietz70@googlemail.com,  	NightStrike <nightstrike@gmail.com>
Subject: Re: Ping - old patch from April - mingw support for I32/I64 MS printf formatters to c-format.c
Date: Sun, 16 Mar 2008 05:54:00 -0000	[thread overview]
Message-ID: <9c03c2dd0803152232w304e2e14qf05d0516185df76c@mail.gmail.com> (raw)
In-Reply-To: <OF7743AA7D.E5908AB7-ONC125740C.0039DECA-C125740C.003BFEEE@onevision.de>

On Fri, Mar 14, 2008 at 11:55 PM, Kai Tietz <Kai.Tietz@onevision.com> w
>  Thank you for the log file. I correct the tested cases so far. The major
>  problem is that by your suggestion 'I64' length specifier isn't treated as
>  equivalent to the gnu 'll' length sepecifier. This is the reason for the
>  failure of a lot of warnings. I let the test-case ms_warnll-1.c as it is
>  for showing the issue. I64 and co are declared as STD_EXT, which is in my
>  opinion not correct. They should be set as STD_C890 IMHO.
>
>  I attached the revised patch.

As I indicated earlier, handling of ms_strftime was  and still is incorrect.

With your patch and this snippet:

#include <time.h>
#include <stdio.h>
#include <sys/types.h>

int main()
{
    char buf[128];
    time_t ltime;
    struct tm* today;

    time (&ltime);
    today =  localtime(&ltime);

    printf ("c, x, y, formats\n");
    strftime (buf, 128, "c: %c\n", today);
    printf (buf);
    strftime (buf, 128, "x: %x\n", today);
    printf (buf);
    strftime (buf, 128, "y: %y\n", today);
    printf (buf);


    printf ("Alternative #c, #x, #y, formats\n");
    strftime (buf, 128, "#c %#c\n", today);
    printf (buf);
    strftime (buf, 128, "#x %#x\n", today);
    printf (buf);
    strftime (buf, 128, "#y %#y\n", today);
    printf (buf);

    return 0;
}

compiled as

gcc -Wall  -Wformat-y2k ms_stftrime_y2k.c

I get:

ms_stftrime_y2k.c: In function 'main':
ms_stftrime_y2k.c:24: warning: '#' flag used with '%c' ms_strftime format
ms_stftrime_y2k.c: warning: '#' flag used with '%x' ms_strftime format
ms_stftrime_y2k.c:28: warning: '#' flag used with '%y' ms_strftime format

1) The warnings are bogus.
2) There are no  y2k warnings, but there should be, because this is the output:

c, x, y, formats
c: 03/16/08 16:05:38
x: 03/16/08
y: 08
Alternative #c, #x, #y, formats
#c Sunday, March 16, 2008 16:05:38
#x Sunday, March 16, 2008
#y 8


Note that '#' does not have glibc meaning.  Instead,  when prefixing c
and x flags, is like 'E'.

http://msdn2.microsoft.com/en-us/library/fe06s4ak(vs.71).aspx

Danny

  reply	other threads:[~2008-03-16  5:32 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.64.0801312346090.5937@digraph.polyomino.org.uk>
2008-02-01 11:04 ` Kai Tietz
2008-02-01 15:52   ` Joseph S. Myers
2008-02-04 14:23     ` Kai Tietz
2008-02-13 18:32       ` Joseph S. Myers
2008-02-19  9:22         ` Kai Tietz
2008-02-19 12:38           ` Joseph S. Myers
2008-02-19 13:30             ` Kai Tietz
2008-02-19 14:10               ` Joseph S. Myers
2008-02-19 15:16                 ` Kai Tietz
2008-02-25 16:46                   ` NightStrike
2008-02-25 16:58                     ` Joseph S. Myers
2008-02-25 17:42                       ` NightStrike
2008-02-25 18:53                   ` Joseph S. Myers
2008-03-04 19:25                     ` Joseph S. Myers
2008-03-10 11:06                     ` Kai Tietz
2008-03-10 22:29                       ` Joseph S. Myers
2008-03-13  0:03                         ` Danny Smith
2008-03-13  8:43                           ` Kai Tietz
2008-03-13  9:29                           ` Kai Tietz
2008-03-13 19:24                             ` Ralf Wildenhues
2008-03-14  9:32                               ` Kai Tietz
2008-03-13 20:52                             ` Danny Smith
2008-03-14 11:00                               ` Kai Tietz
2008-03-16  5:54                                 ` Danny Smith [this message]
2008-03-16 12:16                                   ` Kai Tietz
2008-03-18  9:12                                     ` [patch]: pr33617 vector modes have to be passed via memory for x86_64-pc-mingw32 Kai Tietz
2008-03-18  9:54                                       ` Kai Tietz
2008-03-18 13:20                                   ` Ping - old patch from April - mingw support for I32/I64 MS printf formatters to c-format.c Kai Tietz
2008-03-18 13:44                                     ` NightStrike
2008-03-18 13:51                                       ` Kai Tietz
2008-03-18 15:07                                       ` Kai Tietz
2008-03-19  5:01                                         ` NightStrike
2008-03-19  6:22                                         ` Danny Smith
2008-03-19  9:42                                           ` Kai Tietz
2008-03-19 13:43                                             ` NightStrike
2008-03-19 13:51                                             ` NightStrike
2008-03-20  1:18                                             ` Danny Smith
2008-03-20  1:18                                               ` NightStrike
2008-03-20  9:54                                               ` Kai Tietz
2008-02-13 21:27       ` Danny Smith
2008-02-19  9:17         ` Kai Tietz
2008-03-13 22:38 FX Coudert
2008-03-14  1:33 ` Joseph S. Myers
2008-03-16  7:58 ` Danny Smith
  -- strict thread matches above, loose matches on Subject: below --
2008-01-16 16:14 Kai Tietz
2007-12-04 17:55 NightStrike
2007-12-04 18:32 ` Joseph S. Myers
2007-12-05 21:35   ` NightStrike
2007-12-05 22:53     ` Joseph S. Myers
2007-12-18 14:06       ` Kai Tietz
2007-12-18 16:30         ` Joseph S. Myers
2007-12-18 21:14         ` Danny Smith
2007-12-20 13:00           ` Kai Tietz
2007-12-20 14:16             ` Joseph S. Myers
2007-12-20 14:30               ` Kai Tietz
2007-12-21 14:03               ` Kai Tietz
2007-12-21 14:38                 ` Joseph S. Myers
2008-01-07 13:56                   ` Kai Tietz
2008-01-07 14:44                     ` Joseph S. Myers
2008-01-07 16:26                       ` Kai Tietz
2008-01-08 14:37                       ` Kai Tietz
2008-01-08 18:18                         ` Joseph S. Myers
2008-01-15 16:45                           ` Kai Tietz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9c03c2dd0803152232w304e2e14qf05d0516185df76c@mail.gmail.com \
    --to=dansmister@gmail.com \
    --cc=Kai.Tietz@onevision.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ktietz70@googlemail.com \
    --cc=nightstrike@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).