LoginSignup
1
0

More than 5 years have passed since last update.

Mac + DMD の環境で ld: warning: pointer not aligned at address が発生する

Posted at

Xcode 8.3 にアップデートした後、 dmd 2.074.0 でコンパイルしたコードを実行すると、以下のようなエラーが出ます(LDCや古いDMDでは発生しません)。

ld: warning: pointer not aligned at address 0x10009CD46 (_D25TypeInfo_AxS5hello6Sample6__initZ + 16 from hello.o)
ld: warning: pointer not aligned at address 0x10009CD36 (_D25TypeInfo_AxS5hello6Sample6__initZ + 0 from hello.o)
ld: warning: pointer not aligned at address 0x10009CD5E (_D12TypeInfo_Hib6__initZ + 16 from hello.o)

(略)

ld: warning: pointer not aligned at address 0x1000ABCB9 (_D3std8datetime13PosixTimeZone6__vtblZ + 32 from /Library/D/dmd/lib/libphobos2.a(datetime_465_53e.o))
ld: warning: pointer not aligned at address 0x1000ABCA1 (_D3std8datetime13PosixTimeZone6__vtblZ + 8 from /Library/D/dmd/lib/libphobos2.a(datetime_465_53e.o))
ld: warning: pointer not aligned at address 0x1000ABCC9 (_D3std8datetime13PosixTimeZone6__vtblZ + 48 from /Library/D/dmd/lib/libphobos2.a(datetime_465_53e.o))

ひとつの回避策は LDC を使うことですが、この問題は既に修正されているので、まだベータ版ではありますが dlang.org のダウンロードページ から DMD Beta 2.074.1-b1 をインストールすることで解決します。

参考: With Xcode 8.3 linker, warnings of "pointer not aligned"

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0