You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Edit: Initially, I only observed this with "declaration without prototype" cases. It seems to appear with other warnings, such as "internal linkage but not defined."
Observed behavior
When a function is declared in a header file and an identically named function prototype is in a source file, ccls produces a warning in the source file instead of the header file. The warning appears at the same spot as it would if it were in the header file.
This only occurs when the header file contains a definition and not a prototype.
Expected behavior
The warning should either appear in the header file where the function is initially declared (as it does when running clang), or at the prototype in the source file.
Steps to reproduce
test.c:
#include"test.h"voida(intx) {}
test.h:
voida();
System information
ccls version (git describe --tags --long): 0.20220729-4-g8bc39595
clang version: 15.0.7
OS: Arch Linux
Editor: nvim
Language client (and version): nvim-lspconfig 08f1f34
The text was updated successfully, but these errors were encountered:
tesselslate
changed the title
Misplaced "declaration without prototype" warnings
Header file warnings appear in source file
Jun 12, 2023
Edit: Initially, I only observed this with "declaration without prototype" cases. It seems to appear with other warnings, such as "internal linkage but not defined."
Observed behavior
When a function is declared in a header file and an identically named function prototype is in a source file, ccls produces a warning in the source file instead of the header file. The warning appears at the same spot as it would if it were in the header file.
This only occurs when the header file contains a definition and not a prototype.
Expected behavior
The warning should either appear in the header file where the function is initially declared (as it does when running clang), or at the prototype in the source file.
Steps to reproduce
test.c:
test.h:
System information
git describe --tags --long
): 0.20220729-4-g8bc39595The text was updated successfully, but these errors were encountered: