[#25936] [Bug:1.9] [rubygems] $LOAD_PATH includes bin directory — Nobuyoshi Nakada <nobu@...>

Hi,

10 messages 2009/10/05

[#25943] Disabling tainting — Tony Arcieri <tony@...>

Would it make sense to have a flag passed to the interpreter on startup that

16 messages 2009/10/05

[#26028] [Bug #2189] Math.atanh(1) & Math.atanh(-1) should not raise an error — Marc-Andre Lafortune <redmine@...>

Bug #2189: Math.atanh(1) & Math.atanh(-1) should not raise an error

14 messages 2009/10/10

[#26222] [Bug #2250] IO::for_fd() objects' finalization dangerously closes underlying fds — Mike Pomraning <redmine@...>

Bug #2250: IO::for_fd() objects' finalization dangerously closes underlying fds

11 messages 2009/10/22

[#26244] [Bug #2258] Kernel#require inside rb_require() inside rb_protect() inside SysV context fails — Suraj Kurapati <redmine@...>

Bug #2258: Kernel#require inside rb_require() inside rb_protect() inside SysV context fails

24 messages 2009/10/22

[#26361] [Feature #2294] [PATCH] ruby_bind_stack() to embed Ruby in coroutine — Suraj Kurapati <redmine@...>

Feature #2294: [PATCH] ruby_bind_stack() to embed Ruby in coroutine

42 messages 2009/10/27

[#26371] [Bug #2295] segmentation faults — tomer doron <redmine@...>

Bug #2295: segmentation faults

16 messages 2009/10/27

[ruby-core:26217] [Bug #2247] Fixing compiler warnings

From: Міхаіл T. <redmine@...>
Date: 2009-10-21 15:59:42 UTC
List: ruby-core #26217
Bug #2247: Fixing compiler warnings
http://redmine.ruby-lang.org/issues/show/2247

Author: Міхаіл T.
Status: Open, Priority: Normal
Category: build
ruby -v: ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]

When debugging a problem, gratuitous compiler warnings often get in the way by obscuring real problems.

This is why projects should try to eliminate them -- so that when a new one pops up, such as when new code is added, or the build is performed on a new platform -- the issue can attract its due attention.

The attached patch fixes warnings, that I observed compiling with ``-Wall -Werror'' on RHEL-5.4/x86_64 system. Please, consider merging these changes in.

The addressed problems are:

 * rb_thread_join was not declared (intern.h) with the rest of the rb_thread functions. Private declarations
   existed in some C-files...
 * The PUSH_FRAME duly defined the local variable _frame as volatile. However, when the value of _frame was
   assigned to the global ruby_frame, this qualifier was lost. There were as many warnings about this, as
   there are invocations of the PUSH_FRAME macro.
 * The little thread_timer() function MUST be declared as returning void*, because it is passed to
   pthread_create(). Compiler warned, that a non-void function lacked the return-statement. I added one...
 * regex.c in its error reporting tried to print ptrdiff_t value as int. On 64-bit platforms ptrdiff_t is,
   usually, long int, but that's an impossibly large value for a regular expression's length.
   Explicit casting of the pointer-difference down to int should be fine.
 * parse.y defined an unused static function arg_prepend()

Also, when compiling with a recent gcc at optimization level -O2 (or higher), util.c throws a number of warnings about breaking strict-aliasing rules. There is no /easy/ fix for this, but the work-around is to simply compile that one file with -fno-strict-aliasing (or whatever flag is needed for this with non-gcc compilers). A /sample/ patch for this issue is attached separately.

Thanks! Yours,

        -mi


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next