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

error: argument 2 null where non-null expected [-Werror=nonnull] #100

Open
hramrach opened this issue Nov 4, 2024 · 0 comments
Open

error: argument 2 null where non-null expected [-Werror=nonnull] #100

hramrach opened this issue Nov 4, 2024 · 0 comments

Comments

@hramrach
Copy link
Contributor

hramrach commented Nov 4, 2024

This looks like a logic error in the code but I don't know what the logic should be.

Other callers pass a scanf type string but this one passes NULL.

So generally some type should be passed but it's not clear what it should be.

CC src/drmgr/common.o
In function ‘get_att_prop’,
inlined from ‘get_property’ at src/drmgr/common.c:802:9,
inlined from ‘valid_platform’ at src/drmgr/common.c:1079:7:
src/drmgr/common.c:773:22: error: argument 2 null where non-null expected [-Werror=nonnull]
773 | rc = fscanf(fp, attr_type, (int *)buf);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:503,
from /usr/include/fcntl.h:25,
from src/drmgr/common.c:21:
/usr/include/stdio.h: In function ‘valid_platform’:
/usr/include/stdio.h:440:12: note: in a call to function ‘fscanf’ declared ‘nonnull’
440 | extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
| ^~~~~~~~~~

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