mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Oeser <ingo.oeser@informatik.tu-chemnitz.de>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: "David S. Miller" <davem@redhat.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add new DMA_ADDR_T_SIZE define
Date: Sat, 22 Feb 2003 11:06:57 +0100	[thread overview]
Message-ID: <20030222110657.K629@nightmaster.csn.tu-chemnitz.de> (raw)
In-Reply-To: <20030219214817.GD4977@gtf.org>; from jgarzik@pobox.com on Wed, Feb 19, 2003 at 04:48:17PM -0500

Hi there,

On Wed, Feb 19, 2003 at 04:48:17PM -0500, Jeff Garzik wrote:
> /me wishes gcc would let the user application define printf formats
> for arbitrary [non-struct] user data types...

Better might be to change the whole protocol over to sth. like
that what PASCAL does but still print into a string. GCC is
type checking and enumerating the arguments for printf and scanf
anyway so it could also supply that information to the functions
itself, if they have a special attribute (__new_style_printf__).

If GCC needs to print/scan a type, it composes a function name
similiar to C++ signatures and calls this. If it does not exists,
it warns at compile time. The decomposition of constant strings
is done at compile time. There is also a GCC function, which does
it at runtime. This is no problem, since index into type name
table and number of arguments is on the stack along with the
varargs. So we only need to specify the numeric format like
hex/numeric, leading zero fill or not, space fill and so on. No
more fiddling with word sizes and signedness.

Even structures may be printed/assigned, by defining a start_level,
next_item and end_level function to print the equivalent of '{'
',' and '}' in the structure.

I would really vote for such an extension to GCC, since doing
this without the help of GCC is error prone (because it's not
really typesafe) and leads to many problems. 

That way even the config file parsers get much simpler, because
you can define the lexical rules with scanf already today and now
you can even define a simple grammar likewise ;-)

But this is not the right list for this, but I just wanted to
braindump that ;-)

Regards

Ingo Oeser
-- 
Science is what we can tell a computer. Art is everything else. --- D.E.Knuth

  reply	other threads:[~2003-02-22 13:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-19 16:26 Ion Badulescu
2003-02-19 17:20 ` Randy.Dunlap
2003-02-19 17:28   ` Ion Badulescu
2003-02-19 22:06     ` David S. Miller
2003-02-19 22:04       ` Ion Badulescu
2003-02-19 22:06   ` David S. Miller
2003-02-19 21:48     ` Jeff Garzik
2003-02-22 10:06       ` Ingo Oeser [this message]
2003-02-19 22:01 ` David S. Miller
2003-02-19 18:11 James Bottomley
2003-02-19 18:20 ` Ion Badulescu
2003-02-19 22:07   ` David S. Miller
2003-02-19 22:41     ` Ion Badulescu
2003-02-19 22:29       ` David S. Miller
2003-02-19 22:53         ` Ion Badulescu
2003-02-19 22:38           ` David S. Miller
2003-02-23  7:02 Albert Cahalan
2003-02-23  7:00 ` David S. Miller
2003-02-23  7:20   ` Albert Cahalan

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=20030222110657.K629@nightmaster.csn.tu-chemnitz.de \
    --to=ingo.oeser@informatik.tu-chemnitz.de \
    --cc=davem@redhat.com \
    --cc=jgarzik@pobox.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®