zmodem wrote:
Here's a small reproducer based on the examples above:
```
$ cat /tmp/a.c
#define ONE 1
#define TWO (1 + ONE)
int x = TWO;
$ build/bin/clang -Wmacro-mixed-operator -c /tmp/a.c
/tmp/a.c:3:9: warning: operator '+' in macro expansion has operand outside the
macro; operator precedence may be different than expected
[-Wmacro-mixed-operator]
3 | int x = TWO;
| ^~~
/tmp/a.c:2:16: note: expanded from macro 'TWO'
2 | #define TWO (1 + ONE)
| ~ ^ ~~~
1 warning generated.
```
https://github.com/llvm/llvm-project/pull/184924
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits