Bug #8495

include/ruby/win32.h assumes that __STRICT_ANSI__ isn’t set

Added by Nikolai Weibull 11 months ago. Updated 9 months ago.

[ruby-core:<unknown>]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
Category:platform/mingw
Target version:-
ruby -v:2.0.0 Backport:1.9.3: UNKNOWN, 2.0.0: UNKNOWN

Description

Hi!

include/ruby/win32.h assumes that STRICT_ANSI isn’t set when it uses controlfp() in rbw32pow(). This isn’t the case if you give, for example, -std=c99 to gcc. If _STRICTANSI_ is set, float.h won’t define _controlfp(), leading to compilation issues.

Associated revisions

Revision 41834
Added by Nobuyoshi Nakada 10 months ago

win32: for strict ANSI

  • threadwin32.c (w32threadstartfunc, threadstartfunc1), (timerthreadfunc): use _stdcall instead of _stdcall which is unavailable in strict ANSI mode. [Bug #8495]
  • win32/win32.c (gettimeofday): use __cdecl instead of _cdecl.

Revision 41835
Added by Nobuyoshi Nakada 10 months ago

numeric.c: for strict ANSI

  • numeric.c (finite): add declaration for strict ANSI. [Bug #8495]

Revision 41836
Added by Nobuyoshi Nakada 10 months ago

win32.c: for strict ANSI

  • win32/win32.c (rbw32pow): move from win32.h and disable strict ANSI mode macro to let _controlfp() stuff defined. [Bug #8495]

Revision 41923
Added by Nobuyoshi Nakada 9 months ago

win32.c: fix infinite recursion

  • win32/win32.c (rbw32pow): undef pow to get rid of infinite recursive call. re-fix [Bug #8495]. [Bug #8621]

History

#1 Updated by Luis Lavena 11 months ago

  • Status changed from Open to Feedback

Hello Nikolai,

Thanks for the report.

Can you provide us with a concrete example where this issue is happening?

Also, seems you've already dig into this to provide this feedback, any particular resolution suggestion?

#2 Updated by Anonymous 11 months ago

On Wed, Jun 5, 2013 at 11:20 AM, luislavena (Luis Lavena)
luislavena@gmail.com wrote:

Issue #8495 has been updated by luislavena (Luis Lavena).

Status changed from Open to Feedback

Hello Nikolai,

Thanks for the report.

Can you provide us with a concrete example where this issue is happening?

As I said, I add -std=c99 to CFLAGS, which defines STRICT_ANSI.
If you want a specific repository, its at http://github.com/now/u/.

Also, seems you've already dig into this to provide this feedback, any particular resolution suggestion?

Change line 793 to

#elif defined(MINGW64VERSIONMAJOR) && !defined(STRICTANSI_)

perhaps?

#3 Updated by Luis Lavena 10 months ago

  • Status changed from Feedback to Assigned
  • Assignee set to Nobuyoshi Nakada

#4 Updated by Nobuyoshi Nakada 9 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r41834.
Nikolai, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


win32: for strict ANSI

  • threadwin32.c (w32threadstartfunc, threadstartfunc1), (timerthreadfunc): use _stdcall instead of _stdcall which is unavailable in strict ANSI mode. [Bug #8495]
  • win32/win32.c (gettimeofday): use __cdecl instead of _cdecl.

Also available in: Atom PDF