Project

General

Profile

Actions

Bug #14366

closed

Not possible to compile ruby C extension when using `-std=c90`

Added by graywolf (Gray Wolf) over 6 years ago. Updated about 6 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0p0 (2017-12-25 revision 61468) [i386-mingw32]
[ruby-core:84898]

Description

DeveloperHowto says that ruby should be C90, not C99, however it's not possible
to compile C extension using -std=c90 command line argument with error:

C:/Ruby25/include/ruby-2.5.0/ruby/defines.h:224:25: warning: ISO C90 does not support 'long long' [-Wlong-long]

 # define LONG_LONG long long

as far a I can tell, long long is only defined by C99, so defines.h
probably shouldn't contain it.

Updated by shyouhei (Shyouhei Urabe) over 6 years ago

  • Status changed from Open to Rejected

Let me reject this. Using long long when available must never be a bad thing.

Also, we do check availability of long long using configure. If you really have to kill long long, try configure --with-gcc="gcc --pedantic-errors" or something like that.

Updated by graywolf (Gray Wolf) over 6 years ago

Out of curiosity, is there any particular reason we still stick with c90?

Updated by naruse (Yui NARUSE) over 6 years ago

graywolf (Gray Wolf) wrote:

Out of curiosity, is there any particular reason we still stick with c90?

Because VC++ and Solaris' cc doesn't support part of C99.
Therefore we use C90+some extensions.
What extensions we use are described at https://bugs.ruby-lang.org/projects/ruby-trunk/wiki/Assumptions

Updated by nobu (Nobuyoshi Nakada) about 6 years ago

It your ruby is compiled with that option, long long should not be used.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0