-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix handling of empty vararg pasting
(GCC extension)
- Loading branch information
1 parent
8f79988
commit acbf004
Showing
4 changed files
with
47 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#define recip(x) (1 / x) | ||
#define recip_safe(x) (x ? 1 / x : 0) | ||
|
||
#define any_recip(x, ...) recip ## __VA_ARGS__(x) | ||
|
||
#define error(x, ...) fprintf(stderr, x, ## __VA_ARGS__) | ||
|
||
int | ||
a() | ||
{ | ||
// Test non-deletion of recip | ||
int b = any_recip(2); | ||
|
||
// Test addition of _safe | ||
int c = any_recip(3, _safe); | ||
|
||
// Test deletion of comma | ||
error("Internal error"); | ||
|
||
// Test non-deletion of comma | ||
error("Errno: %d", errno); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
int main(); | ||
static void _cscout_dummy1(void) { _cscout_dummy1(); } | ||
int | ||
a() | ||
{ | ||
int b = (1 / 2); | ||
int c = (3 ? 1 / 3 : 0); | ||
fprintf(stderr, "Internal error"); | ||
fprintf(stderr, "Errno: %d",errno); | ||
} |