MacRuby compile issues.

warning are printed twice for each arch, is this by design?

~/Developer/MacRuby-> clang -I. -I./include -I/usr/include/libxml2 -arch i386 -arch x86_64 -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated-declarations -Werror -c iseq.c -o iseq.o
clang: warning: argument unused during compilation: ‘-fno-common’
clang: warning: argument unused during compilation: ‘-Wno-parentheses’
clang: warning: argument unused during compilation: ‘-Wno-deprecated-declarations’
iseq.c:345:45: warning: expression result unused
static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
^~~~~~~~~~~
./include/ruby/ruby.h:384:34: note: instantiated from:
#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x))
^
./include/ruby/ruby.h:227:21: note: instantiated from:
#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
^
./include/ruby/config.h:223:25: note: instantiated from:
#define RSHIFT(x,y) ((x)>>(int)y)

1 diagnostic generated.
iseq.c:345:45: warning: expression result unused
static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;}
^~~~~~~~~~~
./include/ruby/ruby.h:384:34: note: instantiated from:
#define NUM2LONG(x) (FIXNUM_P(x)?FIX2LONG(x):rb_num2long((VALUE)x))
^
./include/ruby/ruby.h:227:21: note: instantiated from:
#define FIX2LONG(x) RSHIFT((SIGNED_VALUE)x,1)
^
./include/ruby/config.h:223:25: note: instantiated from:
#define RSHIFT(x,y) ((x)>>(int)y)
~~~^
1 diagnostic generated.

**with saved-temps warning is much more readable.**

==== with saved-temps =============

~/Developer/MacRuby-> clang -I. -I./include -I/usr/include/libxml2 -arch i386 -save-temps -fno-common -pipe -O2 -g -Wall -Wno-parentheses -Wno-deprecated-declarations -Werror -c iseq.c -o iseq.o
clang: warning: argument unused during compilation: '-fno-common'
clang: warning: argument unused during compilation: '-Wno-parentheses'
clang: warning: argument unused during compilation: '-Wno-deprecated-declarations'
In file included from iseq.c:1:
iseq.c:345:87: warning: expression result unused
static inline VALUE CHECK_INTEGER(VALUE v) {((((long)(v))&RUBY_FIXNUM_FLAG)?(((long)v)>>(int)1):rb_num2long((VALUE)v)); return v;}
~~~~~~~~~^ ~~~~~~
1 diagnostic generated.

I'd call it an unfortunate consequence.

That is “by design”, but is unfortunate. Consider it twice the incentive to fix your code :wink:

However, from the dump, it looks like this is a possible false positive. Can you file a bugzilla with a .i file?

-Chris