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

reg warnings #87

Open
polluks opened this issue Sep 30, 2024 · 0 comments
Open

reg warnings #87

polluks opened this issue Sep 30, 2024 · 0 comments

Comments

@polluks
Copy link
Contributor

polluks commented Sep 30, 2024

gcc but not clang

cc -c -Wall -O2 reg.c
reg.c: In function 'reg_putraw':
reg.c:50:18: warning: array subscript [-128, 255] is outside array bounds of 'char *[256]' [-Warray-bounds]
   50 |         free(bufs[tolower(c)]);
      |              ~~~~^~~~~~~~~~~~
reg.c:7:14: note: while referencing 'bufs'
    7 | static char *bufs[256];
      |              ^~~~
reg.c:51:13: warning: array subscript [-128, 255] is outside array bounds of 'char *[256]' [-Warray-bounds]
   51 |         bufs[tolower(c)] = buf;
      |         ~~~~^~~~~~~~~~~~
reg.c:7:14: note: while referencing 'bufs'
    7 | static char *bufs[256];
      |              ^~~~
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