You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
nice catch! Thanks for reporting this. The issue comes from the do-while inside an if or else. The macro has nothing to do with it. A fix is on its way.
Invalid semicolons get inserted when using certain define macros.
For example, the well known
do { stuff; } while (0)
macro wrapper trick expands incorrectly.'Example:
Expands into
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)
The text was updated successfully, but these errors were encountered: