* thread.c (rb_thread_atfork_internal): My compiler complains

about this variable being used before initialized. I looked at
  the code and expanded the macro and turned out it was actually
  USED for pointer arithmetic, not dereferenced.  So this was
  never a serious bug.  But is annoying indeed to see warnings
  every time.  I added `=0` and all went healthy.

* configure.in: Also, I found that the problematic macro expansion
  only happens when we lack __typeof__ C extension, which shall
  not be the case of my compiler.  I added AC_CTYPEOF to kick ass.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shyouhei 2014-05-31 12:24:28 +00:00
parent f84ef81dad
commit e00ac16763
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,16 @@
Sat May 31 21:15:43 2014 URABE Shyouhei <shyouhei@ruby-lang.org>
* thread.c (rb_thread_atfork_internal): My compiler complains
about this variable being used before initialized. I looked at
the code and expanded the macro and turned out it was actually
USED for pointer arithmetic, not dereferenced. So this was
never a serious bug. But is annoying indeed to see warnings
every time. I added `=0` and all went healthy.
* configure.in: Also, I found that the problematic macro expansion
only happens when we lack __typeof__ C extension, which shall
not be the case of my compiler. I added AC_CTYPEOF to kick ass.
Sat May 31 16:32:50 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
* lib/ipaddr.rb: extracted inline tests into test dir.

View File

@ -1188,6 +1188,7 @@ AC_C_CONST
AC_C_CHAR_UNSIGNED
AC_C_INLINE
AC_C_VOLATILE
AC_C_TYPEOF
AS_CASE(":$ac_cv_c_const:$ac_cv_c_volatile:",
[*:no:*], [AC_MSG_ERROR(ANSI C-conforming const and volatile are mandatory)])

View File

@ -3770,7 +3770,7 @@ static void
rb_thread_atfork_internal(void (*atfork)(rb_thread_t *, const rb_thread_t *))
{
rb_thread_t *th = GET_THREAD();
rb_thread_t *i;
rb_thread_t *i = 0;
rb_vm_t *vm = th->vm;
vm->main_thread = th;