public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
To: Marc.Espie@liafa.jussieu.fr
Cc: Marc Espie <espie@quatramaran.ens.fr>, gcc@gcc.gnu.org
Subject: Re: size_t printf warnings and preprocessor
Date: Thu, 12 Jul 2001 08:54:00 -0000	[thread overview]
Message-ID: <hou20ijg84.fsf@gee.suse.de> (raw)
In-Reply-To: <20010712175140.A3097@schutzenberger.liafa.jussieu.fr>

Marc Espie <espie@schutzenberger.liafa.jussieu.fr> writes:

> On Thu, Jul 12, 2001 at 05:48:52PM +0200, Andreas Jaeger wrote:
>> Marc Espie <espie@quatramaran.ens.fr> writes:
>> 
>> > I would love to get size_t warnings for printf out of gcc.
>> > I've already noticed that 3.0 is much better at following typeinfo than
>> > 2.95 used to.
>> > 
>> > I would like to have a switch such that 
>> > size_t var;
>> > printf(format, var);
>> > 
>> > invariably ends in an error, as there can't be a single format that works
>> > with size_t.
>> 
>> "%z" is specified by ISO C 99 for size_t.  So what's wrong with printf
>> ("%z\n", var) ?
>> 
>> Sorry, I'm lost with your proposal.
> 
> Nothing is wrong, I don't have the C99 proposal with me... :)
> 
> Okay, what I'm proposing still makes sense in the legacy case, for people
> who have written code before %z and who would like it checked.
> 
> Also, in pedantic C99 mode, do we warn when size_t is used without %z ?

Now I get it - you do it the other way round.  You want to allow
size_t only with %z and forbid e.g. "%ld", var or even "%ld",(long)var.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

  reply	other threads:[~2001-07-12  8:54 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-05  7:39 [GCC 3.0] Bad regression, binary size Marc Espie
2001-07-05  7:51 ` Marc Espie
2001-07-05  8:07   ` Joern Rennecke
2001-07-05  8:12     ` Marc Espie
2001-07-05  8:17   ` David Edelsohn
2001-07-05  8:22     ` Marc Espie
2001-07-05 15:14 ` Geoff Keating
2001-07-07 13:09 ` Richard Henderson
2001-07-07 14:41   ` Jamie Lokier
2001-07-07 16:45     ` Richard Henderson
2001-07-08 14:28       ` Linus Torvalds
2001-07-08 23:59         ` Marc Espie
2001-07-09  6:06           ` Tim Prince
2001-07-09  9:10           ` Linus Torvalds
2001-07-09  9:28             ` Marc Espie
2001-07-09  9:58               ` Linus Torvalds
2001-07-09 10:10             ` Paolo Carlini
2001-07-09 14:49         ` Richard Henderson
2001-07-09 15:23           ` Linus Torvalds
2001-07-09 15:55             ` Joern Rennecke
2001-07-09 16:14               ` Linus Torvalds
2001-07-09 16:05             ` Richard Henderson
2001-07-09 16:24               ` Linus Torvalds
2001-07-12  8:41 ` size_t printf warnings and preprocessor Marc Espie
2001-07-12  8:49   ` Andreas Jaeger
2001-07-12  8:52     ` Marc Espie
2001-07-12  8:54       ` Andreas Jaeger [this message]
2001-07-12  9:10   ` Joseph S. Myers
  -- strict thread matches above, loose matches on Subject: below --
1999-09-13 21:45 type based aliasing again N8TM
1999-09-14  4:01 ` Marc Espie
1999-09-14  9:56   ` David Edelsohn
1999-09-14 10:10     ` Richard Earnshaw
1999-09-14 10:31       ` Nick Ing-Simmons
1999-09-14 10:52         ` David Edelsohn
1999-09-14 11:11           ` craig
1999-09-14 14:44             ` David Edelsohn
1999-09-30 18:02               ` David Edelsohn
1999-09-14 15:06             ` David Edelsohn
1999-09-14 17:35               ` Marc Lehmann
1999-09-30 18:02                 ` Marc Lehmann
1999-09-14 23:41               ` craig
1999-09-15  8:28                 ` Marc Lehmann
1999-09-30 18:02                   ` Marc Lehmann
1999-09-15  9:19                 ` David Edelsohn
1999-09-15  9:59                   ` Nick Ing-Simmons
1999-09-15 15:33                     ` David Edelsohn
1999-09-30 18:02                       ` David Edelsohn
1999-09-30 18:02                     ` Nick Ing-Simmons
1999-09-15 10:01                   ` craig
1999-09-30 18:02                     ` craig
1999-09-30 18:02                   ` David Edelsohn
1999-09-30 18:02                 ` craig
1999-09-30 18:02               ` David Edelsohn
1999-09-30 18:02             ` craig
1999-09-14 11:58           ` Gerald Pfeifer
1999-09-30 18:02             ` Gerald Pfeifer
1999-09-30 18:02           ` David Edelsohn
1999-09-14 11:01         ` craig
1999-09-14 11:14           ` craig
1999-09-30 18:02             ` craig
1999-09-14 11:39           ` Mark Mitchell
1999-09-14 14:48             ` Toon Moene
1999-09-14 15:00               ` David Edelsohn
1999-09-14 16:01                 ` Toon Moene
1999-09-14 16:15                   ` David Edelsohn
1999-09-14 16:43                     ` Mark Mitchell
1999-09-30 18:02                       ` Mark Mitchell
1999-09-14 17:39                     ` Marc Lehmann
1999-09-30 18:02                       ` Marc Lehmann
1999-09-30 18:02                     ` David Edelsohn
1999-09-14 16:19                   ` dvv
1999-09-14 17:38                     ` Michael Meissner
1999-09-30 18:02                       ` Michael Meissner
1999-09-30 18:02                     ` Dima Volodin
1999-09-30 18:02                   ` Toon Moene
1999-09-30 18:02                 ` David Edelsohn
1999-09-14 15:08               ` Mark Mitchell
1999-09-30 18:02                 ` Mark Mitchell
1999-09-30 18:02               ` Toon Moene
1999-09-30 18:02             ` Mark Mitchell
1999-09-30 18:02           ` craig
1999-09-14 23:46         ` Geoff Keating
1999-09-15  7:47           ` Nick Ing-Simmons
1999-09-30 18:02             ` Nick Ing-Simmons
1999-09-30 18:02           ` Geoff Keating
1999-09-30 18:02         ` Nick Ing-Simmons
1999-09-30 18:02       ` Richard Earnshaw
1999-09-14 17:22     ` Marc Lehmann
1999-09-30 18:02       ` Marc Lehmann
1999-09-30 18:02     ` David Edelsohn
1999-09-14 17:23   ` Marc Lehmann
1999-09-15  1:59     ` Marc Espie
1999-09-15  8:28       ` Marc Lehmann
1999-09-30 18:02         ` Marc Lehmann
1999-09-30 18:02       ` Marc Espie
1999-09-30 18:02     ` Marc Lehmann
1999-09-15  2:01   ` Jeffrey A Law
1999-09-30 18:02     ` Jeffrey A Law
1999-09-30 18:02   ` Marc Espie
1999-09-30 18:02 ` N8TM

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=hou20ijg84.fsf@gee.suse.de \
    --to=aj@suse.de \
    --cc=Marc.Espie@liafa.jussieu.fr \
    --cc=espie@quatramaran.ens.fr \
    --cc=gcc@gcc.gnu.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).