Avoid initializer-string warning for the digits array#495
Merged
Conversation
Some newer compilers emit this warning:
```
warning: initializer-string for character array is too long, array size is 36
but initializer has size 37 (including the null terminating character);
did you mean to use the 'nonstring' attribute? [-Wunterminated-string-initialization]
12146 | static char const digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
To avoid the warning initialize the array as individual characters
suchipi
added a commit
to suchipi/quickjs
that referenced
this pull request
May 18, 2026
…ady ported via d38eea9)
suchipi
added a commit
to suchipi/quickjs
that referenced
this pull request
May 18, 2026
…kva/fix-initializer-string-warning GitHub merge commit for PR bellard#495; the underlying change is d38eea9, already ported.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some newer compilers emit this warning:
To avoid the warning initialize the array as individual characters