Project

General

Profile

Bug #14366

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

Added by graywolf (Gray Wolf) almost 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
Normal
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.

History

Updated by shyouhei (Shyouhei Urabe) almost 2 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) almost 2 years ago

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

Updated by naruse (Yui NARUSE) almost 2 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) almost 2 years ago

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

Also available in: Atom PDF