Which C standard

Hi,

Which C standard does MRI use? When I run configure on HP-UX, it seems
to use C89.

I recently ran into an issue compiling the gherkin gem. Seems that the
C code in that gem makes use of C99 features like variable declarations
in the middle of a block, and variable length arrays.

Is it a bug in the gem to be using these features, or a bug in the MRI
configure script to set the CFLAGS such that C89 is selected at compile
time?

Cheers,
Gra.

On Mon, Aug 16, 2010 at 07:41:03PM +0900, Graham A. wrote:

Hi,

Which C standard does MRI use? When I run configure on HP-UX, it seems
to use C89.

MRI uses C89.

I recently ran into an issue compiling the gherkin gem. Seems that the
C code in that gem makes use of C99 features like variable declarations
in the middle of a block, and variable length arrays.

Is it a bug in the gem to be using these features, or a bug in the MRI
configure script to set the CFLAGS such that C89 is selected at compile
time?

I’m not sure about this part. Is your compiler enforcing the C89
standard because Ruby is compiled as C89?

The platforms I work on don’t do that, so I’m not sure who to talk to.
It doesn’t seem fair for MRI to force C89 upon gem authors, but at the
same time MRI is written using C89 standard. :-/

Sorry if this wasn’t too helpful.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs