# Which C standard

**URL:** <https://www.ruby-forum.com/t/which-c-standard/193349>\
**Category:** Ruby\
**Created:** [August 16, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/which-c-standard/193349 "2010-08-16T12:40:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![graza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/838e76/32.png) [@graza](https://www.ruby-forum.com/u/graza)\
**Post date:** [August 16, 2010, 12:40pm UTC](https://www.ruby-forum.com/t/which-c-standard/193349/1 "2010-08-16T12:40:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![graza](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/838e76/32.png) [@graza](https://www.ruby-forum.com/u/graza)\
**Post date:** [August 17, 2010, 3:10am UTC](https://www.ruby-forum.com/t/which-c-standard/193349/2 "2010-08-17T03:10:38Z")

</div>

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.
