KFAFSP wrote:

I don't want to make this more complicated, but since this has already outgrown 
the 2-line fix it was supposed to be, I ought to document the process a bit 
more. Also, I need a bit more guidance if you want me to fix this. Thank you 
for your consideration.

#### Diagnostics

This is a listing of all diagnostics in the `implicit-int` category emitted by 
clang, grouped by the language modes in which they occur. Bear in mind, these 
modes are usually by exclusion, so more languages can be affected, and OpenCL 
is too by default.

- C89/C90
  - WARN 
[`Parser.cpp:1190`](https://github.com/llvm/llvm-project/blob/ed19bbfe01d4fcf5d457cb563cb900763b8f2189/clang/lib/Parse/Parser.cpp#L1190)
  - WARN+FIX 
[`SemaType.cpp:981`](https://github.com/llvm/llvm-project/blob/ed19bbfe01d4fcf5d457cb563cb900763b8f2189/clang/lib/Sema/SemaType.cpp#L981)
    - No test for the FixIt.
    - Addressed by this PR, and _no_ test for FixIt provided.
- C99
  - EXTWARN+FIX 
[`SemaDecl.cpp:15882`](https://github.com/llvm/llvm-project/blob/ed19bbfe01d4fcf5d457cb563cb900763b8f2189/clang/lib/Sema/SemaDecl.cpp#L15882)
    - Has a test that includes the FixIt.
  - EXTWARN+FIX 
[`SemaType.cpp:1005`](https://github.com/llvm/llvm-project/blob/ed19bbfe01d4fcf5d457cb563cb900763b8f2189/clang/lib/Sema/SemaType.cpp#L1005)
    - No test for the FixIt.
    - Addressed by this PR, and test for FixIt provided.
- C23, C++
  - ERROR 
[`SemaType.cpp:990`](https://github.com/llvm/llvm-project/blob/ed19bbfe01d4fcf5d457cb563cb900763b8f2189/clang/lib/Sema/SemaType.cpp#L990)

This raises the following questions:

- Shouldn't `Parser.cpp:1190` emit a FixIt too? Or, should `SemaType.cpp:981` 
_not_ emit a FixIt, considering it is "allowed" syntax? Either way, that's 
inconsistent.
- Should we create a new FixIt test file that invokes clang in C89/C90 mode 
just to test the WARN+FIX? That includes the existing one without a test, and 
the possible new one.

#### Tests

Here is a listing (no particular order, may not be exhaustive) of all the 
_intentional_ invocations of these behaviors that I found in the tests, 
excluding all the cases where its the "catch-all" for "that thing that wasn't 
declared", or could have been substituted by anything else:

- 
[`fixit.c:32`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/FixIt/fixit.c#L32)
- 
[`declarators.c:67`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Parser/declarators.c#L67)
- 
[`objc-forcollection-neg-2.m:27`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Parser/objc-forcollection-neg-2.m#L27)
- 
[`address_spaces.c:12`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/address_spaces.c#L12)
- 
[`block-literal.c:44`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/block-literal.c#L44)
- 
[`function.c:21`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/function.c#L21)
- 
[`function.c:43`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/function.c#L43)
- 
[`implicit-int.c`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/implicit-int.c)
- 
[`redefinition.c:6`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/redefinition.c#L6)
- 
[`return.c:193`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/return.c#L193)
- 
[`warn-strict-prototypes.c:62`](https://github.com/llvm/llvm-project/blob/f6ee5bd4dfea88604ac27c0cc11b48ec1500e325/clang/test/Sema/warn-strict-prototypes.c#L62)

https://github.com/llvm/llvm-project/pull/179356
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to