Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Import CRuby change to explicitly ignore GCC extension warning

In my case, I have a C extension where I compile with
the -Werror option. The MacRuby ruby.h header generated
this warning as a result:

/Users/mrada/Library/Frameworks/MacRuby.framework/Versions/0.13/usr/include/ruby-1.9.2/ruby/st.h:69: warning: type of bit-field ‘num_entries’ is a GCC extension
  • Loading branch information...
commit b158b1b89891ce388d968286f8ffdbe619ed936c 1 parent d3ed408
@ferrous26 ferrous26 authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 include/ruby/st.h
12 include/ruby/st.h
@@ -66,6 +66,18 @@ struct st_table {
const struct st_hash_type *type;
st_index_t num_bins;
unsigned int entries_packed : 1;
+#ifdef __GNUC__
+ /*
+ * C spec says,
+ * A bit-field shall have a type that is a qualified or unqualified
+ * version of _Bool, signed int, unsigned int, or some other
+ * implementation-defined type. It is implementation-defined whether
+ * atomic types are permitted.
+ * In short, long and long long bit-field are implementation-defined
+ * feature. Therefore we want to supress a warning explicitly.
+ */
+ __extension__
+ #endif
st_index_t num_entries : ST_INDEX_BITS - 1;
struct st_table_entry **bins;
struct st_table_entry *head, *tail;
Please sign in to comment.
Something went wrong with that request. Please try again.