[#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:26166] [Bug #2234] Macros defined in win32.h cause some code to fail to compile.

From: Thomas Stephens <redmine@...>
Date: 2009-10-19 16:23:14 UTC
List: ruby-core #26166
Bug #2234: Macros defined in win32.h cause some code to fail to compile.
http://redmine.ruby-lang.org/issues/show/2234

Author: Thomas Stephens
Status: Open, Priority: Normal
ruby -v: ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]

The Windows-only win32.h defines some macros which map Microsoft's _foo functions to functions of the same name, but without the underscore. By making these macros, there is a possibility that the preprocessor can perform macro-substitution where it was not intended.

As an example, consider this macro definition in win32.h:
#ifndef finite
#define finite(x) _finite(x)
#endif

Given the attached example code, when the struct's member variable, finite, is initialized in the initializer list, the preprocessor interprets finite(0) as a call to the macro, finite(x), and replaces it with _finite(0). The C++ compiler then attempts to initialize the member, _finite, to 0, and there is a compilation error (because the struct does not have a member named _finite).

Please consider replacing these macros with inline functions. The resulting assembled code should be equivalent, and the inline function both preserves type-safety and prevents namespace polution.


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

In This Thread

Prev Next