public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kai Tietz <Kai.Tietz@onevision.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: Danny Smith <dansmister@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	        NightStrike <nightstrike@gmail.com>
Subject: Re: Ping - old patch from April - mingw support for I32/I64 MS printf          formatters to c-format.c
Date: Tue, 19 Feb 2008 13:30:00 -0000	[thread overview]
Message-ID: <OF7FEF09DA.3A183381-ONC12573F4.00469818-C12573F4.00473B7C@onevision.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0802191222340.16189@digraph.polyomino.org.uk>

"Joseph S. Myers" <joseph@codesourcery.com> wrote on 19.02.2008 13:28:31:

> On Tue, 19 Feb 2008, Kai Tietz wrote:
> 
> > > "formatter" is nowhere used in the existing code to refer to kinds 
of 
> > > formats; I suggest just using "format" throughout the patch.
> > 
> > 
> > It is renamed to sys_format.c, fine?
> 
> I mean everywhere: in all the function names, not just in one file name.
> 
> > > > +/* For none gnu style formatter types we need to compare the none
> > > gnu formatter
> > > > +   and a gnu style formatter style to compare in kind.   This is 
> > > done via the
> > > > +   array TARGET_OVERRIDES_FORMAT_ATTRIBUTES.  The argument 
> > > custom_type specifiers
> > > > +   the index of the formatter. The argument def_type specifies 
> > > the gnu style
> > > > +   formatter index to be compare with. If the kind is equal it 
> > > returns true,
> > > > +   otherwise false.  */
> > > > +static int
> > > 
> > > What should this return for comparing each pair of strftime, 
> > gnu_strftime, 
> > > ms_strftime?  I can't tell from the comment.
> > > 
> > > Actually, I don't think we need this function.  The comparisons 
against 
> > > specific types that you change to call this function are used for 
two 
> > > things: processing GCC-internal formats, and giving the error 
"strftime 
> > > formats cannot format arguments".  For the former, there will be no 
> > > target-specific variants; these formats are the same everywhere. For 

> > the 
> > > latter, it would be better to replace the hardcoded check for 
> > > strftime_format_type with a check for the format not setting 
> > > FMT_FLAG_ARG_CONVERT in its flags; that's the right condition to 
check. 
> > > The diagnostic should name the particular attribute in use, whether 
> > > "strftime", "gnu_strftime" or "ms_strftime" (that is, the attribute 
in 
> > the 
> > > user's source code, not any translated version of it).
> > 
> > IMHO, this method is necessary to be able to use the existing argument 

> > checking routines and generalize the existing code.
> > If we have user defined formatters extensions, we need to get their 
gnu 
> > style variant. So we can check, if the attribute has a formatter, 
needs 
> > additional arguments, and if the formatter can be NULL, and so on.
> 
> I still can't tell what the definition is for what is considered "equal" 

> or not, and in particular what the answers should be for each pair of 
the 
> three attributes I listed above.
I treated the enums simply as kinds, not as index positions. What is a bit 
wired here in fact. I agree, that this is no fast and good solution as it 
is.

> The code should not be comparing against particular enum values.  It 
> should:
> 
> * Get a structure with information about the format (possibly converting 

> "strftime" to "gnu_strftime" or "ms_strftime" in the process, for 
> example).
> 
> * Look up information in that structure.  This information will tell 
> everything about format strings, additional arguments etc..
> 
> The only exception might be for the GCC-internal types, where you know 
> there will never be system-specific variants.

What's about extending the attribute definition structure by a kind member 
and compare instead of index position, there kind? So this function is no 
longer necessary and we need just in the c-format.h enum values defining 
kinds.

typedef enum {
 attr_kind_printf=0,
 attr_kind_scanf,
 ...
} attr_kind;

And we can remove the doubled enum list.

 Kai Tietz

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

  reply	other threads:[~2008-02-19 12:58 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 [this message]
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
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=OF7FEF09DA.3A183381-ONC12573F4.00469818-C12573F4.00473B7C@onevision.de \
    --to=kai.tietz@onevision.com \
    --cc=dansmister@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.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).