1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress

warnings for unused variables.

* ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to
  suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2012-12-13 03:09:22 +00:00
parent 14d72e6685
commit 3a6dec0c5d
3 changed files with 15 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Thu Dec 13 12:07:25 2012 Shugo Maeda <shugo@ruby-lang.org>
* include/ruby/ruby.h (RB_UNUSED_VAR): new macro to suppress
warnings for unused variables.
* ext/bigdecimal/bigdecimal.c (ENTER): use RB_UNUSED_VAR() to
suppress annoying warnings by -Wunused-but-set-variable in gcc 4.6.
Thu Dec 13 11:22:33 2012 Koichi Sasada <ko1@atdot.net>
* method.h: remove "VM_METHOD_TYPE__MAX" from rb_method_type_t.

View file

@ -60,7 +60,7 @@ static ID id_to_r;
static ID id_eq;
/* MACRO's to guard objects from GC by keeping them in stack */
#define ENTER(n) volatile VALUE vStack[n];int iStack=0
#define ENTER(n) volatile VALUE RB_UNUSED_VAR(vStack[n]);int iStack=0
#define PUSH(x) vStack[iStack++] = (VALUE)(x);
#define SAVE(p) PUSH(p->obj);
#define GUARD_OBJ(p,y) {p=y;SAVE(p);}

View file

@ -529,6 +529,12 @@ static inline volatile VALUE *rb_gc_guarded_ptr(volatile VALUE *ptr) {return ptr
#endif
#define RB_GC_GUARD(v) (*RB_GC_GUARD_PTR(&(v)))
#ifdef __GNUC__
#define RB_UNUSED_VAR(x) x __attribute__ ((unused))
#else
#define RB_UNUSED_VAR(x) x
#endif
void rb_check_type(VALUE,int);
#define Check_Type(v,t) rb_check_type((VALUE)(v),(t))