mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05: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
1 changed files with 1 additions and 1 deletions
|
@ -823,7 +823,7 @@ reswitch: switch (ch) {
|
||||||
(PRI_EXTRA_MARK_LEN < 1 || \
|
(PRI_EXTRA_MARK_LEN < 1 || \
|
||||||
(*(s) == PRI_EXTRA_MARK[0] && \
|
(*(s) == PRI_EXTRA_MARK[0] && \
|
||||||
(PRI_EXTRA_MARK_LEN == 1 || \
|
(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)))
|
PRI_EXTRA_MARK_LEN-1) == 0)))
|
||||||
#else
|
#else
|
||||||
# define PRI_EXTRA_MARK_LEN 0
|
# define PRI_EXTRA_MARK_LEN 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue