Project

General

Profile

Bug #12527

warning: macro redefined: REG_PC and REG_SP on Solaris 10

Added by ngoto (Naohisa Goto) almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
[ruby-dev:49693]

Description

Solaris 10 上にて、vm.c のコンパイル中に、以下のマクロ再定義のwarningが出ます。

cc -errtags=yes  -xO4 -xtarget=sparc64viiplus -m64 -DRUBY_EXPORT -I/usr/local/64/lib/libffi-3.0.10/include -I/usr/local/64/include  -D_XOPEN_SOURCE=500   -I. -I.ext/include/sparc64-solaris2.10 -I./include -I. -o vm.o -c vm.c
"vm_insnhelper.h", line 45: warning: macro redefined: REG_PC (E_MACRO_REDEFINED)
"vm_insnhelper.h", line 46: warning: macro redefined: REG_SP (E_MACRO_REDEFINED)

具体的には、/usr/include/sys/regset.h の以下の定義と衝突しています。

#define REG_PC  (1)
#define REG_SP  REG_O6

(厳密に確認はしていませんがおそらく) _XOPEN_SOURCE=500 以上を定義した場合に、これらのマクロが有効となるようです。

値は異なるようですが、 x86 (amd64) でも定義されているようです。
http://dtrace.org/blogs/rm/2011/03/14/a-trip-down-into-sysregset-h/

幸い、今のところは、vm.c や vm.c がincludeしているファイル内では、システム側のマクロは直接・間接関わらず使用されていないように見えます。

Associated revisions

Revision b0569e3d
Added by ko1 (Koichi Sasada) over 2 years ago

  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56609
Added by ko1 (Koichi Sasada) over 2 years ago

  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

Revision 56609
Added by ko1 (Koichi Sasada) over 2 years ago

  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

Revision 56609
Added by ko1 (Koichi Sasada) over 2 years ago

  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

Revision 56609
Added by ko1 (Koichi Sasada) over 2 years ago

  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

Revision d4c598c4
Added by nobu (Nobuyoshi Nakada) about 2 years ago

fix macro name

  • tool/instruction.rb (VmBodyGenerator#make_header_prepare_stack):
    REG_CFP has been prefixed with VM_ at r56609. [Bug #12527]

  • tool/instruction.rb (VmBodyGenerator#make_footer_stack_val):
    ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 57792
Added by nobu (Nobuyoshi Nakada) about 2 years ago

fix macro name

  • tool/instruction.rb (VmBodyGenerator#make_header_prepare_stack):
    REG_CFP has been prefixed with VM_ at r56609. [Bug #12527]

  • tool/instruction.rb (VmBodyGenerator#make_footer_stack_val):
    ditto.

Revision 57792
Added by nobu (Nobuyoshi Nakada) about 2 years ago

fix macro name

  • tool/instruction.rb (VmBodyGenerator#make_header_prepare_stack):
    REG_CFP has been prefixed with VM_ at r56609. [Bug #12527]

  • tool/instruction.rb (VmBodyGenerator#make_footer_stack_val):
    ditto.

Revision 57792
Added by nobu (Nobuyoshi Nakada) about 2 years ago

fix macro name

  • tool/instruction.rb (VmBodyGenerator#make_header_prepare_stack):
    REG_CFP has been prefixed with VM_ at r56609. [Bug #12527]

  • tool/instruction.rb (VmBodyGenerator#make_footer_stack_val):
    ditto.

History

Updated by shyouhei (Shyouhei Urabe) almost 3 years ago

  • Assignee set to ko1 (Koichi Sasada)
  • Status changed from Open to Assigned
#2

Updated by ko1 (Koichi Sasada) over 2 years ago

  • Status changed from Assigned to Closed

Applied in changeset r56609.


  • vm_insnhelper.h: rename REG_(CFP|PC|SP|EP) to VM_REG_....
    [Bug #12527]

  • vm_exec.c: ditto.

Also available in: Atom PDF