[ruby/date] Suppress warnings by gcc-13 with -Og
https://github.com/ruby/date/commit/6dd7969a64
This commit is contained in:
parent
edaa27ce45
commit
998e5791c5
@ -3878,7 +3878,6 @@ static VALUE
|
|||||||
rt_complete_frags(VALUE klass, VALUE hash)
|
rt_complete_frags(VALUE klass, VALUE hash)
|
||||||
{
|
{
|
||||||
static VALUE tab = Qnil;
|
static VALUE tab = Qnil;
|
||||||
int g;
|
|
||||||
long e;
|
long e;
|
||||||
VALUE k, a, d;
|
VALUE k, a, d;
|
||||||
|
|
||||||
@ -3975,9 +3974,13 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|||||||
rb_gc_register_mark_object(tab);
|
rb_gc_register_mark_object(tab);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
k = Qnil;
|
||||||
long i, eno = 0, idx = 0;
|
|
||||||
|
|
||||||
|
{
|
||||||
|
long i, eno = 0;
|
||||||
|
VALUE t = Qnil;
|
||||||
|
|
||||||
|
e = 0;
|
||||||
for (i = 0; i < RARRAY_LEN(tab); i++) {
|
for (i = 0; i < RARRAY_LEN(tab); i++) {
|
||||||
VALUE x, a;
|
VALUE x, a;
|
||||||
|
|
||||||
@ -3992,23 +3995,20 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|||||||
n++;
|
n++;
|
||||||
if (n > eno) {
|
if (n > eno) {
|
||||||
eno = n;
|
eno = n;
|
||||||
idx = i;
|
t = x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (eno == 0)
|
if (eno > 0) {
|
||||||
g = 0;
|
k = RARRAY_AREF(t, 0);
|
||||||
else {
|
a = RARRAY_AREF(t, 1);
|
||||||
g = 1;
|
|
||||||
k = RARRAY_AREF(RARRAY_AREF(tab, idx), 0);
|
|
||||||
a = RARRAY_AREF(RARRAY_AREF(tab, idx), 1);
|
|
||||||
e = eno;
|
|
||||||
}
|
}
|
||||||
|
e = eno;
|
||||||
}
|
}
|
||||||
|
|
||||||
d = Qnil;
|
d = Qnil;
|
||||||
|
|
||||||
if (g && !NIL_P(k) && (RARRAY_LEN(a) - e)) {
|
if (!NIL_P(k) && (RARRAY_LEN(a) > e)) {
|
||||||
if (k == sym("ordinal")) {
|
if (k == sym("ordinal")) {
|
||||||
if (NIL_P(ref_hash("year"))) {
|
if (NIL_P(ref_hash("year"))) {
|
||||||
if (NIL_P(d))
|
if (NIL_P(d))
|
||||||
@ -4095,7 +4095,7 @@ rt_complete_frags(VALUE klass, VALUE hash)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g && k == sym("time")) {
|
if (k == sym("time")) {
|
||||||
if (f_le_p(klass, cDateTime)) {
|
if (f_le_p(klass, cDateTime)) {
|
||||||
if (NIL_P(d))
|
if (NIL_P(d))
|
||||||
d = date_s_today(0, (VALUE *)0, cDate);
|
d = date_s_today(0, (VALUE *)0, cDate);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* ANSI-C code produced by gperf version 3.1 */
|
/* ANSI-C code produced by gperf version 3.3 */
|
||||||
/* Command-line: gperf --ignore-case -L ANSI-C -C -c -P -p -j1 -i 1 -g -o -t -N zonetab zonetab.list */
|
/* Command-line: gperf --ignore-case -L ANSI-C -C -c -P -p -j1 -i 1 -g -o -t -N zonetab zonetab.list */
|
||||||
/* Computed positions: -k'1-4,9' */
|
/* Computed positions: -k'1-4,9' */
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ struct zone;
|
|||||||
|
|
||||||
#ifndef GPERF_DOWNCASE
|
#ifndef GPERF_DOWNCASE
|
||||||
#define GPERF_DOWNCASE 1
|
#define GPERF_DOWNCASE 1
|
||||||
static unsigned char gperf_downcase[256] =
|
static const unsigned char gperf_downcase[256] =
|
||||||
{
|
{
|
||||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||||
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
|
||||||
@ -144,6 +144,11 @@ hash (register const char *str, register size_t len)
|
|||||||
{
|
{
|
||||||
default:
|
default:
|
||||||
hval += asso_values[(unsigned char)str[8]];
|
hval += asso_values[(unsigned char)str[8]];
|
||||||
|
#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 8:
|
case 8:
|
||||||
case 7:
|
case 7:
|
||||||
@ -151,12 +156,27 @@ hash (register const char *str, register size_t len)
|
|||||||
case 5:
|
case 5:
|
||||||
case 4:
|
case 4:
|
||||||
hval += asso_values[(unsigned char)str[3]];
|
hval += asso_values[(unsigned char)str[3]];
|
||||||
|
#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 3:
|
case 3:
|
||||||
hval += asso_values[(unsigned char)str[2]];
|
hval += asso_values[(unsigned char)str[2]];
|
||||||
|
#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 2:
|
case 2:
|
||||||
hval += asso_values[(unsigned char)str[1]+6];
|
hval += asso_values[(unsigned char)str[1]+6];
|
||||||
|
#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))
|
||||||
|
[[fallthrough]];
|
||||||
|
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||||
|
__attribute__ ((__fallthrough__));
|
||||||
|
#endif
|
||||||
/*FALLTHROUGH*/
|
/*FALLTHROUGH*/
|
||||||
case 1:
|
case 1:
|
||||||
hval += asso_values[(unsigned char)str[0]+52];
|
hval += asso_values[(unsigned char)str[0]+52];
|
||||||
@ -807,6 +827,10 @@ static const struct stringpool_t stringpool_contents =
|
|||||||
const struct zone *
|
const struct zone *
|
||||||
zonetab (register const char *str, register size_t len)
|
zonetab (register const char *str, register size_t len)
|
||||||
{
|
{
|
||||||
|
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||||
|
#endif
|
||||||
static const struct zone wordlist[] =
|
static const struct zone wordlist[] =
|
||||||
{
|
{
|
||||||
{-1}, {-1},
|
{-1}, {-1},
|
||||||
@ -1541,6 +1565,9 @@ zonetab (register const char *str, register size_t len)
|
|||||||
#line 141 "zonetab.list"
|
#line 141 "zonetab.list"
|
||||||
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str619, -10800}
|
{(int)(size_t)&((struct stringpool_t *)0)->stringpool_str619, -10800}
|
||||||
};
|
};
|
||||||
|
#if (defined __GNUC__ && __GNUC__ + (__GNUC_MINOR__ >= 6) > 4) || (defined __clang__ && __clang_major__ >= 3)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
|
||||||
{
|
{
|
||||||
@ -1558,7 +1585,7 @@ zonetab (register const char *str, register size_t len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return (struct zone *) 0;
|
||||||
}
|
}
|
||||||
#line 330 "zonetab.list"
|
#line 330 "zonetab.list"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user