Commit 56c3b8e
authored
[clang][Sema] Make format size estimator aware of %p's existence in format string (#65969)
This change introduces `-Wformat-overflow` and `-Wformat-truncation` warning flags that were formerly diagnosed from `-Wfortify-source` warning group.
This also introduces `-Wformat-overflow-non-kprintf` and `-Wformat-truncation-non-kprintf`, both of which will be used when the format string contains `%p` format string.
The rationale for this is that Linux kernel has its own extension for `%p` format specifier, and we need some way to suppress false positives in kernel codebase.
The approach of this patch aims NOT to affect non-kernel codebases.
Note that GCC stops format size estimation upon `%p` format specifier.
As requested in #648711 parent ff7e854 commit 56c3b8e
File tree
7 files changed
+225
-24
lines changed- clang
- docs
- include/clang/Basic
- lib/Sema
- test
- Misc
- Sema
7 files changed
+225
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
191 | 201 | | |
192 | 202 | | |
193 | 203 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
964 | 970 | | |
965 | 971 | | |
966 | 972 | | |
967 | | - | |
| 973 | + | |
968 | 974 | | |
969 | 975 | | |
970 | 976 | | |
| |||
1400 | 1406 | | |
1401 | 1407 | | |
1402 | 1408 | | |
1403 | | - | |
| 1409 | + | |
1404 | 1410 | | |
1405 | 1411 | | |
1406 | 1412 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
857 | | - | |
| 857 | + | |
858 | 858 | | |
859 | | - | |
860 | | - | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
861 | 868 | | |
862 | | - | |
| 869 | + | |
863 | 870 | | |
864 | | - | |
865 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
866 | 880 | | |
867 | 881 | | |
868 | 882 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
857 | 860 | | |
858 | 861 | | |
859 | 862 | | |
| |||
933 | 936 | | |
934 | 937 | | |
935 | 938 | | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
936 | 943 | | |
937 | 944 | | |
938 | 945 | | |
| |||
990 | 997 | | |
991 | 998 | | |
992 | 999 | | |
| 1000 | + | |
993 | 1001 | | |
994 | 1002 | | |
995 | 1003 | | |
| |||
1259 | 1267 | | |
1260 | 1268 | | |
1261 | 1269 | | |
1262 | | - | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1263 | 1273 | | |
1264 | 1274 | | |
1265 | 1275 | | |
| |||
1350 | 1360 | | |
1351 | 1361 | | |
1352 | 1362 | | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
1357 | 1374 | | |
1358 | 1375 | | |
1359 | 1376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
0 commit comments