-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
preprocessor: fix duplicate pw3_padded_arg warnings (#834)
- Loading branch information
Showing
4 changed files
with
46 additions
and
8 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
6 changes: 6 additions & 0 deletions
6
libs/preprocessor/tests/warnings/pw3_padded_arg_inner/source.hpp
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,6 @@ | ||
#define TEST1(var1, var2) INNER(var1, var2) | ||
#define TEST2(var1, var2) INNER(var1, var2) // Separate macro to trigger unique warning for INNER padding | ||
#define INNER(var1, var2) var1 var2 | ||
|
||
TEST1(John,Smith); // Only inner | ||
TEST2(John, Smith); // Both call and inner |
27 changes: 27 additions & 0 deletions
27
libs/preprocessor/tests/warnings/pw3_padded_arg_inner/stderr.ansi
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,27 @@ | ||
[0m[1m[38;5;11mwarning[PW3][0m[1m: padding a macro argument[0m | ||
[0m[36m┌─[0m source.hpp:1:38 | ||
[0m[36m│[0m | ||
[0m[36m1[0m [0m[36m│[0m #define TEST1(var1, var2) INNER(var1,[0m[33m [0mvar2) | ||
[0m[36m│[0m [0m[33m^[0m [0m[33mpadding a macro argument[0m | ||
[0m[36m│[0m | ||
[0m[36m=[0m [36mnote[0m: padding a macro argument is likely unintended | ||
[0m[36m=[0m [36mnote[0m: occured in: `INNER` | ||
|
||
[0m[1m[38;5;11mwarning[PW3][0m[1m: padding a macro argument[0m | ||
[0m[36m┌─[0m source.hpp:6:12 | ||
[0m[36m│[0m | ||
[0m[36m6[0m [0m[36m│[0m TEST2(John,[0m[33m [0mSmith); // Both call and inner | ||
[0m[36m│[0m [0m[33m^[0m [0m[33mpadding a macro argument[0m | ||
[0m[36m│[0m | ||
[0m[36m=[0m [36mnote[0m: padding a macro argument is likely unintended | ||
[0m[36m=[0m [36mnote[0m: occured in: `TEST2` | ||
|
||
[0m[1m[38;5;11mwarning[PW3][0m[1m: padding a macro argument[0m | ||
[0m[36m┌─[0m source.hpp:2:38 | ||
[0m[36m│[0m | ||
[0m[36m2[0m [0m[36m│[0m #define TEST2(var1, var2) INNER(var1,[0m[33m [0mvar2) // Separate macro to trigger unique warning for INNER padding | ||
[0m[36m│[0m [0m[33m^[0m [0m[33mpadding a macro argument[0m | ||
[0m[36m│[0m | ||
[0m[36m=[0m [36mnote[0m: padding a macro argument is likely unintended | ||
[0m[36m=[0m [36mnote[0m: occured in: `INNER` | ||
|