clang++のBoost対応状況 part.2
さっきのテストだと,shared_ptrによるエラーが全体を引っ張ってる感じだった.そこでshared_ptr.hppインクルード時のエラーを見たところ,アサーションに引っかかってるのは#if !defined(BOOST_SP_NO_ATOMIC_ACCESS)の中の行だったので,BOOST_SP_NO_ATOMIC_ACCESSをdefineしてみたところshared_ptrを使ったソースのコンパイルに成功した.というわけで改めて次のようにテストをやりなおしてみた.
for name in BoostBook2nd/*/*.cpp(:r); do ~/llvm/Release/bin/clang++ -DBOOST_SP_NO_ATOMIC_ACCESS -c ${name}.cpp -o ${name}.clang++.o; done for name in BoostBook2nd/*/*.cpp(:r); do g++ -c ${name}.cpp -o ${name}.g++.o; done diff -U 255 <(ls BoostBook2nd/*/*.g++.o | sed 's/\..*//') <(ls BoostBook2nd/*/*.clang++.o | sed 's/\..*//')
その結果(行頭-がg++でのみ成功,行頭+がclang++でのみ成功)
BoostBook2nd/1-String/format1 BoostBook2nd/1-String/format2 BoostBook2nd/1-String/format3 BoostBook2nd/1-String/format4 BoostBook2nd/1-String/lexcast1 BoostBook2nd/1-String/lexcast2 BoostBook2nd/1-String/regex1 BoostBook2nd/1-String/regex2 BoostBook2nd/1-String/regex3 BoostBook2nd/1-String/regex4 +BoostBook2nd/1-String/regex5 BoostBook2nd/1-String/string_algo1 BoostBook2nd/1-String/string_algo2 BoostBook2nd/1-String/string_algo3 BoostBook2nd/1-String/string_algo4 BoostBook2nd/1-String/string_algo5 BoostBook2nd/1-String/tokenizer1 BoostBook2nd/1-String/tokenizer2 BoostBook2nd/1-String/tokenizer3 -BoostBook2nd/1-String/xpressive1 -BoostBook2nd/1-String/xpressive2 -BoostBook2nd/1-String/xpressive3 -BoostBook2nd/1-String/xpressive4 -BoostBook2nd/1-String/xpressive6 -BoostBook2nd/1-String/xpressive7 -BoostBook2nd/1-String/xpressive8 -BoostBook2nd/1-String/xpressive9 -BoostBook2nd/10-Misc/graph1 BoostBook2nd/10-Misc/param BoostBook2nd/10-Misc/po BoostBook2nd/10-Misc/signals1 BoostBook2nd/10-Misc/signals2 -BoostBook2nd/10-Misc/ublas1 -BoostBook2nd/10-Misc/wave BoostBook2nd/2-SmartP/shared_ptr1 BoostBook2nd/2-SmartP/weak_ptr1 BoostBook2nd/3-System/filesystem1 BoostBook2nd/3-System/fsls BoostBook2nd/3-System/fsmv BoostBook2nd/3-System/gregorian1 BoostBook2nd/3-System/gregorian_calender -BoostBook2nd/3-System/posix_time1 -BoostBook2nd/3-System/posix_time2 BoostBook2nd/3-System/thread1 BoostBook2nd/4-IO/add_server BoostBook2nd/4-IO/addmul_server2 BoostBook2nd/4-IO/addmul_server3 BoostBook2nd/4-IO/asio1 BoostBook2nd/4-IO/asio2 BoostBook2nd/4-IO/asio3 BoostBook2nd/4-IO/gzview BoostBook2nd/4-IO/iostreams1 BoostBook2nd/4-IO/iostreams2 BoostBook2nd/4-IO/iostreams3 BoostBook2nd/4-IO/iostreams4 BoostBook2nd/4-IO/serialization1 BoostBook2nd/4-IO/serialization2 BoostBook2nd/4-IO/serialization4 BoostBook2nd/5-Math/crc1 BoostBook2nd/5-Math/crcchk BoostBook2nd/5-Math/interval1 BoostBook2nd/5-Math/interval2 BoostBook2nd/5-Math/quaternion1 BoostBook2nd/5-Math/quaternion2 BoostBook2nd/5-Math/random1 -BoostBook2nd/5-Math/random2 -BoostBook2nd/5-Math/random3 BoostBook2nd/5-Math/rational1 BoostBook2nd/6-Data/any1 BoostBook2nd/6-Data/any2 BoostBook2nd/6-Data/array1 BoostBook2nd/6-Data/array2 BoostBook2nd/6-Data/dynbitset1 BoostBook2nd/6-Data/dynbitset2 BoostBook2nd/6-Data/ite_adapt1 BoostBook2nd/6-Data/ite_facade1 BoostBook2nd/6-Data/multi_array1 BoostBook2nd/6-Data/multi_array2 BoostBook2nd/6-Data/multi_array3 -BoostBook2nd/6-Data/optional1 BoostBook2nd/6-Data/range1 BoostBook2nd/6-Data/range2 BoostBook2nd/6-Data/tuple1 BoostBook2nd/6-Data/tuple2 BoostBook2nd/6-Data/variant1 -BoostBook2nd/6-Data/variant2 -BoostBook2nd/6-Data/variant3 BoostBook2nd/6-Data/variant4 BoostBook2nd/7-Func/bind1 BoostBook2nd/7-Func/bind2 BoostBook2nd/7-Func/bind3 BoostBook2nd/7-Func/bind4 -BoostBook2nd/7-Func/function1 -BoostBook2nd/7-Func/lambda1 -BoostBook2nd/7-Func/spirit1 -BoostBook2nd/7-Func/spirit10 -BoostBook2nd/7-Func/spirit2 -BoostBook2nd/7-Func/spirit3 -BoostBook2nd/7-Func/spirit5 -BoostBook2nd/7-Func/spirit6 -BoostBook2nd/7-Func/spirit7 -BoostBook2nd/7-Func/spirit8 -BoostBook2nd/7-Func/spirit9 -BoostBook2nd/8-Meta/fusion2 -BoostBook2nd/8-Meta/fusion3 -BoostBook2nd/8-Meta/fusion4 BoostBook2nd/8-Meta/mpl1 BoostBook2nd/8-Meta/mpl2 BoostBook2nd/8-Meta/mpl3 BoostBook2nd/8-Meta/mpl4-5 BoostBook2nd/8-Meta/mplaf BoostBook2nd/8-Meta/pp3 BoostBook2nd/8-Meta/pp4 BoostBook2nd/8-Meta/type_traits1 BoostBook2nd/9-Util/assignment1 -BoostBook2nd/9-Util/foreach1 BoostBook2nd/9-Util/ios_saver1 BoostBook2nd/9-Util/next1 BoostBook2nd/9-Util/operators1 BoostBook2nd/9-Util/ref1 BoostBook2nd/9-Util/timer1
shared_ptrがコンパイルできるようになったことで,成功するものがかなり増えたことがわかる.regex5についてはg++で失敗してclang++で成功する唯一の例なので見てみたところ,
BoostBook2nd/1-String/regex5.cpp: In function ‘int main()’: BoostBook2nd/1-String/regex5.cpp:9: error: converting to execution character set: 無効または不完全なマルチバイトまたはワイド文字です BoostBook2nd/1-String/regex5.cpp:10: error: converting to execution character set: 無効または不完全なマルチバイトまたはワイド文字です BoostBook2nd/1-String/regex5.cpp:11: error: converting to execution character set: 無効または不完全なマルチバイトまたはワイド文字です BoostBook2nd/1-String/regex5.cpp:12: error: converting to execution character set: 無効または不完全なマルチバイトまたはワイド文字です
とエラーが出ていた.ソースをUTF-8に変換すればg++でもコンパイルできることは確認したけど,どうやらワイド文字列リテラル内で使える文字集合に違いがあるっぽい?
boost::foreachなどboost::addressofが通らないのが原因なエラーがいくつかあるようだ.