Issue 55489
Summary clang flase-positive implicit declaration
Labels new issue
Assignees
Reporter JAicewizard
    I am fairly certain that I have found a false positive in clang, using the latest from the arch Linux repos.

`clang --version`:
```
clang version 13.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /sbin
```

Example program:
```
#include <stdio.h>

int main() {
	char password[256];
	gets(password);
}
```

clang output when compiling file above:
```
main.c:5:2: warning: implicit declaration of function 'gets' is invalid in C99 [-Wimplicit-function-declaration]
        gets(password);
        ^
1 warning generated.
/sbin/ld: /tmp/main-88b226.o: in function `main':
main.c:(.text+0x22): warning: the `gets' function is dangerous and should not be used.
```

This is not an implicit declaration of `gets`, as I imported `stdio.h` and `gets` is defined in this header per the standard. 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to