зеркало из https://github.com/github/ruby.git
suppress warnings
* string.c (rb_str_enumerate_lines): hint to suppress a maybe-uninitialized warning by gcc. * thread.c (rb_fd_no_init): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5c0aa3ad92
Коммит
959aac29e7
3
string.c
3
string.c
|
@ -7517,6 +7517,9 @@ rb_str_enumerate_lines(int argc, VALUE *argv, VALUE str, int wantarray)
|
|||
wantarray = 0;
|
||||
#endif
|
||||
}
|
||||
#if defined __GNUC__ && !defined __clang__
|
||||
ASSUME(wantarray || !ary); /* if wantarray, ary does not matter */
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (wantarray)
|
||||
|
|
12
thread.c
12
thread.c
|
@ -3573,8 +3573,8 @@ rb_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *excep
|
|||
return select(n, r, w, e, timeout);
|
||||
}
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 6
|
||||
#define rb_fd_no_init(fds) ASSUME(!(fds)->maxfd)
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
# define rb_fd_no_init(fds) ASSUME(!(fds)->fdset && !(fds)->maxfd)
|
||||
#endif
|
||||
|
||||
#undef FD_ZERO
|
||||
|
@ -3640,6 +3640,10 @@ rb_fd_set(int fd, rb_fdset_t *set)
|
|||
#define FD_CLR(i, f) rb_fd_clr((i), (f))
|
||||
#define FD_ISSET(i, f) rb_fd_isset((i), (f))
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
# define rb_fd_no_init(fds) ASSUME(!(fds)->fdset)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef rb_fd_no_init
|
||||
|
@ -3673,8 +3677,8 @@ update_timeval(struct timeval *timeout, double limit)
|
|||
}
|
||||
|
||||
static int
|
||||
do_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds,
|
||||
rb_fdset_t *exceptfds, struct timeval *timeout)
|
||||
do_select(int n, rb_fdset_t *const readfds, rb_fdset_t *const writefds,
|
||||
rb_fdset_t *const exceptfds, struct timeval *timeout)
|
||||
{
|
||||
int MAYBE_UNUSED(result);
|
||||
int lerrno;
|
||||
|
|
Загрузка…
Ссылка в новой задаче