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

Bugfix: char-subscripts are treated as an error. #58

Merged
merged 1 commit into from Dec 10, 2020

Conversation

kou1okada
Copy link
Contributor

At least in Cygwin, isspace () will fail to compile as below if it takes char as an argument.

$ make
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
In file included from src/error.h:11,
                 from src/clinfo.c:35:
src/strbuf.h: In function ‘skip_leading_ws’:
src/strbuf.h:128:8: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  128 |  while (isspace(*ret)) ++ret;
      |        ^~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: clinfo.o] Error 1

For more details and recommendations for this error, see following:

At least in Cygwin, isspace () will fail to compile as below if it takes char as an argument.

```
$ make
cc -g -pedantic -Werror -std=c99 -Wall -Wextra -I../OpenCL-Headers  -c -o clinfo.o src/clinfo.c
In file included from src/error.h:11,
                 from src/clinfo.c:35:
src/strbuf.h: In function ‘skip_leading_ws’:
src/strbuf.h:128:8: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  128 |  while (isspace(*ret)) ++ret;
      |        ^~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: clinfo.o] Error 1
```

For more details and recommendations for this error, see following:

* stackoverflow / 2012-04-02: [Warning: array subscript has type char](https://stackoverflow.com/a/60696378)
@Oblomov Oblomov merged commit 340f771 into Oblomov:master Dec 10, 2020
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

Successfully merging this pull request may close these issues.

None yet

2 participants