🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4737

Are macros expanded within unused macro arguments?

#4737
From: Michael Greenberg
Date: Thu, 01 Feb 1996 13:19
24 lines
1122 bytes
Is the following program legal?

#define foo(unused)
#define bar(x,y)

foo(bar(1))

Excerpt from "6.8.3.1 Argument substitution"

  After the arguments for the invocation of a function-like macro have
  been identified, argument substitution takes place. A parameter in the
  replacment list, ..., is replaced by the corresponding argument after
  all macros contained therein have been expanded. Before being
  substituted, each argument's preprocessing tokens are completely macro
  replaced ... .



--
Michael Greenberg                      email: mgreenberg@scr.siemens.com
Siemens Corporate Research             phone: 609-734-3347
755 College Road East                  fax: 609-734-6565
Princeton, NJ 08540
Technical Details
Message-ID: <DM3MC3.Atv@scr.siemens.com>
Path: arc1-ca.pugleaf.net!in2.uu.net!siemens!mlg

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!in2.uu.net!siemens!mlg
From: mlg@scr.siemens.com (Michael Greenberg)
Subject: Are macros expanded within unused macro arguments?
Message-ID: <DM3MC3.Atv@scr.siemens.com>
Sender: news@scr.siemens.com (NeTnEwS)
Nntp-Posting-Host: tucker.scr.siemens.com
Organization: Siemens Corporate Research, Princeton, NJ
Date: Thu, 1 Feb 1996 13:19:14 GMT