-
-
Notifications
You must be signed in to change notification settings - Fork 262
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Invalid semicolons get inserted when using certain define macros.
For example, the well known do { stuff; } while (0) macro wrapper trick expands incorrectly.'
Example:
#define foo(x) do { return (x); } while (0)
int f(int num)
{
if (num > 0)
foo(num);
else
return num * num;
}
Expands into
int f(int num)
{
if(num > 0) do {
return (num);
} while(0);
;
else return num * num;
}
Which has incorrectly inserted an additional semicolon between the if/else blocks (or automatically inserted one after while(0), causing the original semicolon to be pushed between blocks)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working