summaryrefslogtreecommitdiff
path: root/strftime.c
diff options
context:
space:
mode:
authorxtkoba <69125751+xtkoba@users.noreply.github.com>2021-04-30 10:09:32 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-04-30 20:56:16 +0900
commit1f255adda93bd7958afc7405026326f630ba4748 (patch)
tree4e20d983ad396e01f6ca2e6655ba49b4e7109329 /strftime.c
parentb2c54f5395ff569e40d36b0f7b344e8323ef83fc (diff)
downloadruby-1f255adda93bd7958afc7405026326f630ba4748.tar.gz
Silence GCC 11 warnings
``` ../strftime.c: In function 'rb_strftime_with_timespec': ../strftime.c:392:39: warning: comparison is always false due to limited range of data type [-Wtype-limits] 392 | if (vtm->wday < 0 || vtm->wday > 6) | ^ ../strftime.c:403:39: warning: comparison is always false due to limited range of data type [-Wtype-limits] 403 | if (vtm->wday < 0 || vtm->wday > 6) | ^ ```
Diffstat (limited to 'strftime.c')
-rw-r--r--strftime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/strftime.c b/strftime.c
index c3d600114f..d963038d94 100644
--- a/strftime.c
+++ b/strftime.c
@@ -389,7 +389,7 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
flags |= BIT_OF(UPPER);
}
- if (vtm->wday < 0 || vtm->wday > 6)
+ if (vtm->wday > 6)
i = 1, tp = "?";
else
i = 3, tp = days_l[vtm->wday];
@@ -400,7 +400,7 @@ rb_strftime_with_timespec(VALUE ftime, const char *format, size_t format_len,
flags &= ~(BIT_OF(LOWER)|BIT_OF(CHCASE));
flags |= BIT_OF(UPPER);
}
- if (vtm->wday < 0 || vtm->wday > 6)
+ if (vtm->wday > 6)
i = 1, tp = "?";
else
i = strlen(tp = days_l[vtm->wday]);