Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning NULL argument for printf %s would benefit from explanation #96

Open
andrew-taylor opened this issue Nov 22, 2023 · 0 comments
Open

Comments

@andrew-taylor
Copy link
Collaborator

$ cat /tmp/a.c
#include <stdio.h>

int main(void) {
	char *p = NULL;
	printf("%s", p);
}
$ dcc a.c
a.c: In function ‘main’:
a.c:5:17: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
    5 |         printf("%s", p);
      |                 ^~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant