public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Zack Weinberg <zack@wolery.cumb.org>
To: Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
Cc: gcc@gcc.gnu.org
Subject: Re: [patch] beginnings of the macro rewrite
Date: Sat, 22 Apr 2000 10:33:00 -0000	[thread overview]
Message-ID: <20000422103307.C8273@wolery.cumb.org> (raw)
In-Reply-To: <200004212015.e3LKFsm06024@sleipnir.valparaiso.cl>

On Fri, Apr 21, 2000 at 04:15:54PM -0400, Horst von Brand wrote:
> Stan Shebs <shebs@apple.com> said on gcc-patches:
> > Zack Weinberg wrote:
> > > IMPORTANT: This drops support for traditional macros.  I will put it
> > > back if people complain loudly enough.  If no one cares then I will
> > > probably drop -traditional entirely, sometime next week.
> > > -Wtraditional still works.
> 
> > It might not get too much reaction on this list, but I suggest
> > you make this checkin anonymously, so the lynch mob of users
> > won't be able to come find you. 1/2 :-)
> > 
> > -traditional will be important to support in GCC for at least
> > another 10 years, possibly longer, depending on the longevity
> > of various old code bases.
> 
> Could somebody enlighten me about what "traditional macros" is being talked
> here?

K+R has significantly different semantics for macro expansion from
standard C.  Highlights include:

- macros are not disabled during their own expansions.  The practical
  effect is that

#define EPERM EPERM

  will cause infinite recursion if you use EPERM anywhere.  There are
  some perverse cases where it might actually be useful, though.

- macro arguments are expanded even inside strings and character
  constants (but no effort is made to quote special characters).

- the # and ## (stringize and paste) operators are not available.

- comments are replaced by nothing _after_ arguments are substituted,
  which means /**/ can be used to paste tokens.

- there is no special protection against accidental token paste; if
  you write

#define foo(x) x+b
foo(+);

you'll get ++b; instead of + +b;

zw

  reply	other threads:[~2000-04-22 10:33 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3900A36C.18989ED4@apple.com>
2000-04-21 17:17 ` Horst von Brand
2000-04-22 10:33   ` Zack Weinberg [this message]
2000-04-22 20:13     ` Marc Espie
2000-04-22 20:20     ` Neil Booth
2000-04-24  8:57     ` Michael Meissner
2000-04-24 17:54       ` Russ Allbery
2000-04-27 15:54     ` Philipp Thomas
2000-04-27 17:32       ` Joe Buck
2000-04-24 23:38   ` Martin Kahlert
2000-04-23  4:04 Richard Kenner
2002-07-04  9:55 C++ binary compatibility between GCC 3.1 and GCC 3.2? Andreas Jaeger
2002-07-04 10:23 ` H. J. Lu
2002-07-05 14:17 ` Mark Mitchell
2002-07-05 14:22   ` Andreas Jaeger
2002-07-05 14:28     ` Mark Mitchell
2002-07-05 14:53       ` David O'Brien
2002-07-05 15:08         ` Mark Mitchell
2002-07-06  5:34           ` Andreas Jaeger
2002-07-06  6:40             ` Gabriel Dos Reis
2002-07-06  6:40               ` Jakub Jelinek
2002-07-06  7:20                 ` Gabriel Dos Reis
2002-07-06  7:53                   ` Andreas Jaeger
2002-07-06  8:54                     ` Gabriel Dos Reis
2002-07-06 11:04                     ` Daniel Jacobowitz
2002-07-06  7:42                 ` Andreas Jaeger
2002-07-06 11:08                   ` Jeff Law
2002-07-06 11:10                     ` Gwenole Beauchesne
2002-07-06  6:19         ` Daniel Egger
2002-07-05 14:46   ` David O'Brien
2002-07-05 15:02     ` Mark Mitchell
2002-07-06  6:28       ` Scott Robert Ladd
2002-07-05 15:02     ` H. J. Lu
2002-07-05 15:12       ` David O'Brien
2002-07-05 15:20         ` H. J. Lu
2002-07-05 16:11           ` Stan Shebs
2002-07-05 16:12             ` David Edelsohn
2002-07-05 16:35               ` Stan Shebs
2002-07-05 22:18               ` Geoff Keating
2002-07-07 23:14               ` Mark Mitchell
2002-07-06  4:56     ` Andreas Jaeger
2002-07-06  6:44       ` Gerald Pfeifer
2002-07-06  7:35         ` Andreas Jaeger
2002-07-06 11:44         ` David O'Brien
2002-07-05 22:35 ` David Edelsohn
2002-07-06  5:40 ` Joseph S. Myers
2002-07-06  6:40   ` Gabriel Dos Reis
2002-07-06  7:49     ` Andreas Jaeger

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=20000422103307.C8273@wolery.cumb.org \
    --to=zack@wolery.cumb.org \
    --cc=gcc@gcc.gnu.org \
    --cc=vonbrand@sleipnir.valparaiso.cl \
    /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).