Chris Lattner | 4b00965 | 2007-07-25 00:24:17 +0000 | [diff] [blame] | 1 | //===---------------------------------------------------------------------===// |
| 2 | // Minor random things that can be improved |
| 3 | //===---------------------------------------------------------------------===// |
Steve Naroff | 7cabb92 | 2008-03-18 20:05:01 +0000 | [diff] [blame] | 4 | |
Chris Lattner | 4b00965 | 2007-07-25 00:24:17 +0000 | [diff] [blame] | 5 | |
Chris Lattner | d8c4f14 | 2007-10-10 18:08:07 +0000 | [diff] [blame] | 6 | Warn about "X && 0x1000" saying that the user may mean "X & 0x1000". |
Chris Lattner | 1b188fd | 2007-10-11 16:06:02 +0000 | [diff] [blame] | 7 | We should do this for any immediate except zero, so long as it doesn't come |
| 8 | from a macro expansion. Likewise for ||. |
Chris Lattner | 4b00965 | 2007-07-25 00:24:17 +0000 | [diff] [blame] | 9 | |
| 10 | //===---------------------------------------------------------------------===// |
| 11 | |
| 12 | Lexer-related diagnostics should point to the problematic character, not the |
| 13 | start of the token. For example: |
| 14 | |
| 15 | int y = 0000\ |
| 16 | 00080; |
| 17 | |
| 18 | diag.c:4:9: error: invalid digit '8' in octal constant |
| 19 | int y = 0000\ |
| 20 | ^ |
| 21 | |
| 22 | should be: |
| 23 | |
| 24 | diag.c:4:9: error: invalid digit '8' in octal constant |
| 25 | 00080; |
| 26 | ^ |
| 27 | |
| 28 | This specific diagnostic is implemented, but others should be updated. |
| 29 | |
| 30 | //===---------------------------------------------------------------------===// |
| 31 | |
Ted Kremenek | 18b4ced | 2007-10-10 18:52:22 +0000 | [diff] [blame] | 32 | C++ (checker): For iterators, warn of the use of "iterator++" instead |
| 33 | of "++iterator" when when the value returned by operator++(int) is |
| 34 | ignored. |