Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-07 Thread Andy Gibbs
On Tuesday, November 06, 2012 12:52 AM, Richard Smith wrote: On Mon, Nov 5, 2012 at 11:22 AM, Andy Gibbs wrote: Ok, I've extended the test case to the following... #define A(...) [ __VA_ARGS__ ] #define B(...) [ , __VA_ARGS__ ] #define C(...) [ , ## __VA_ARGS__ ] #define D(A,...) [ A ,

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-07 Thread Andy Gibbs
On Wednesday, November 07, 2012 6:30 PM, Andy Gibbs wrote: Attached is a replacement patch... Oops, attached *now* is the replacement patch! sorry fix.diff Description: Binary data ___ cfe-commits mailing list cfe-commits@cs.uiuc.edu

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Eli Friedman
On Sun, Nov 4, 2012 at 3:10 PM, Andy Gibbs andyg1...@hotmail.co.uk wrote: Hi, Please could someone review the attached patch for me before I commit it. This patch fixes the rules surrounding the removal of a leading comma where a __VA_ARGS__ expansion is empty. GCC has the extension,

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Jean-Daniel Dupas
Le 5 nov. 2012 à 09:08, Eli Friedman eli.fried...@gmail.com a écrit : On Sun, Nov 4, 2012 at 3:10 PM, Andy Gibbs andyg1...@hotmail.co.uk wrote: Hi, Please could someone review the attached patch for me before I commit it. This patch fixes the rules surrounding the removal of a leading

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Andy Gibbs
On Monday, November 05, 2012 9:50 AM, Jean-Daniel Dupas wrote: Le 5 nov. 2012 à 09:08, Eli Friedman a écrit : On Sun, Nov 4, 2012 at 3:10 PM, Andy Gibbs wrote: Hi, Please could someone review the attached patch for me before I commit it. This patch fixes the rules surrounding the removal

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Jean-Daniel Dupas
Le 5 nov. 2012 à 12:07, Andy Gibbs andyg1...@hotmail.co.uk a écrit : On Monday, November 05, 2012 9:50 AM, Jean-Daniel Dupas wrote: Le 5 nov. 2012 à 09:08, Eli Friedman a écrit : On Sun, Nov 4, 2012 at 3:10 PM, Andy Gibbs wrote: Hi, Please could someone review the attached patch for me

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Eli Friedman
On Mon, Nov 5, 2012 at 3:07 AM, Andy Gibbs andyg1...@hotmail.co.uk wrote: On Monday, November 05, 2012 9:50 AM, Jean-Daniel Dupas wrote: Le 5 nov. 2012 à 09:08, Eli Friedman a écrit : On Sun, Nov 4, 2012 at 3:10 PM, Andy Gibbs wrote: Hi, Please could someone review the attached patch for

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Andy Gibbs
On Monday, November 05, 2012 6:50 PM, Eli Friedman wrote: On Mon, Nov 5, 2012 at 3:07 AM, Andy Gibbs wrote: Here is the line from the gcc help: ... In this case the C99 standard is clear that the comma must remain, however the existing GCC extension used to swallow the comma. So CPP retains

Re: [cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-05 Thread Richard Smith
On Mon, Nov 5, 2012 at 11:22 AM, Andy Gibbs andyg1...@hotmail.co.uk wrote: On Monday, November 05, 2012 6:50 PM, Eli Friedman wrote: On Mon, Nov 5, 2012 at 3:07 AM, Andy Gibbs wrote: Here is the line from the gcc help: ... In this case the C99 standard is clear that the comma must remain,

[cfe-commits] [Patch] Fix for comma-removal ahead of __VA_ARGS__ in macros

2012-11-04 Thread Andy Gibbs
Hi, Please could someone review the attached patch for me before I commit it. This patch fixes the rules surrounding the removal of a leading comma where a __VA_ARGS__ expansion is empty. GCC has the extension, implemented already in clang for... #define M(...) call(a, ## __VA_ARGS__) This