Project

General

Profile

Feature #3018 » uninitialized_var.diff

kosaki (Motohiro KOSAKI), 03/26/2010 10:40 PM

View differences:

thread.c
2412 2412
	  struct timeval *timeout)
2413 2413
{
2414 2414
    int result, lerrno;
2415
    fd_set orig_read, orig_write, orig_except;
2416
#if defined __GNUC__ && defined __x86_64__
2417
#define FAKE_FD_ZERO(f) (*(int *)&(f)=0) /* suppress lots of warnings */
2418
#else
2419
#define FAKE_FD_ZERO(f) ((void)0)
2420
#endif
2415
    fd_set UNINITIALIZED_VAR(orig_read);
2416
    fd_set UNINITIALIZED_VAR(orig_write);
2417
    fd_set UNINITIALIZED_VAR(orig_except);
2421 2418

  
2422 2419
#ifndef linux
2423 2420
    double limit = 0;
......
2439 2436
    }
2440 2437
#endif
2441 2438

  
2442
    if (read) orig_read = *read; else FAKE_FD_ZERO(orig_read);
2443
    if (write) orig_write = *write; else FAKE_FD_ZERO(orig_write);
2444
    if (except) orig_except = *except; else FAKE_FD_ZERO(orig_except);
2445

  
2446
#undef FAKE_FD_ZERO
2439
    if (read) orig_read = *read;
2440
    if (write) orig_write = *write;
2441
    if (except) orig_except = *except;
2447 2442

  
2448 2443
  retry:
2449 2444
    lerrno = 0;
vm_core.h
106 106
#define UNLIKELY(x) (x)
107 107
#endif /* __GNUC__ >= 3 */
108 108

  
109
#if __GNUC__ >= 3
110
#define UNINITIALIZED_VAR(x) x = x
111
#else
112
#define UNINITIALIZED_VAR(x) x
113
#endif
114

  
109 115
typedef unsigned long rb_num_t;
110 116

  
111 117
/* iseq data type */