mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Use array indexing with considering clang's feeling
```
In file included from sprintf.c:1256:
./vsnprintf.c:833:8: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
IS_PRI_EXTRA_MARK(fmt)) {
^~~~~~~~~~~~~~~~~~~~~~
./vsnprintf.c:826:34: note: expanded from macro 'IS_PRI_EXTRA_MARK'
strncmp((s)+1, PRI_EXTRA_MARK+1, \
~~~~~~~~~~~~~~^~
./vsnprintf.c:833:8: note: use array indexing to silence this warning
./vsnprintf.c:826:34: note: expanded from macro 'IS_PRI_EXTRA_MARK'
strncmp((s)+1, PRI_EXTRA_MARK+1, \
^
1 warning generated.
```
This commit is contained in:
parent
d53b669948
commit
2789bdddc7
@ -823,7 +823,7 @@ reswitch: switch (ch) {
|
||||
(PRI_EXTRA_MARK_LEN < 1 || \
|
||||
(*(s) == PRI_EXTRA_MARK[0] && \
|
||||
(PRI_EXTRA_MARK_LEN == 1 || \
|
||||
strncmp((s)+1, PRI_EXTRA_MARK+1, \
|
||||
strncmp((s)+1, &PRI_EXTRA_MARK[1], \
|
||||
PRI_EXTRA_MARK_LEN-1) == 0)))
|
||||
#else
|
||||
# define PRI_EXTRA_MARK_LEN 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user