This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Function-like macro definitions
- To: gcc at gcc dot gnu dot org
- Subject: Function-like macro definitions
- From: Neil Booth <NeilB at earthling dot net>
- Date: Fri, 19 May 2000 19:44:38 +0900
- Cc: Zack Weinberg <zack at wolery dot cumb dot org>
We're a bit loose in our syntax checking of the parameter lists in the
definition of function-like macros.
It seems to me that we allow commas without intervening parameter
names, and parameter names without intervening commas, i.e.
#define foo(g h,,) g h
is a valid 2-parameter macro definition.
I've tightened this up in what I'm working on. Is there any good
reason for that being the case?
Also, I'm considering reducing the status of redefinitions like
#define F(X) X
#define F(Y) Y
where the only difference is the spelling of the parameters, from hard
error to pedantic warning.
Are there objections to any of the above?
Neil.