Skip to content

reg warnings #87

@polluks

Description

@polluks

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];
      |              ^~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions