Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
注意
最強に汚いWorkaroundが含まれています。メンテナンス性を十分に検討してからmergeしてください
手元のCentOS7環境ではこのWorkaroundなしでは
のようなエラーが出ていました。これは極めて危険でC11で削除された
gets
関数を参照しているために発生しているものです。この問題を解決する正攻法は
[Clang][C++14][Linux] Clangで標準ライブラリのヘッダでコンパイルエラーが出る場合の対処法 - Qiita
にあるように、libc++を使うか
c++ - clang seems to use the gcc libraries - Stack Overflow
GCC4.9.2以降付属のlibstdc++を使うことです。
が、これは管理者権限のないユーザーには、gccを一からビルドすることを要求することになるので、気軽に勧められません。
(というか私の環境だとそんなにストレージに空きがない
ref: https://yumetodo.hateblo.jp/entry/2017/07/01/123416
そこで登場したのがこの汚いworkaroundです。必要なのは
gets
の定義ではなく宣言のみであることを利用しを予め宣言することで回避します。
このworkaroundは
cstdio
を読み込むより前に読み込む必要があり、cstdio
はstring
やストリーム系ヘッダ(もっとも基底のios
やその派生クラスのあるfstream
/iostream
/sstream
ヘッダーなど)なんかで読み込まれています。つまり大抵のファイルの先頭でこのworkaroundのあるファイルをincludeする必要があります。これは言うまでもなくメンテナンス性を下げるworkaroundです。
採用しない場合は 42c55b7 8ec5dc3 を除外してrebaseする必要があります。
概要
な環境でビルドが通るように。
お知らせ
のような定義が大量にありましたが、この
noexcept
はつけてはいけませんというか
のように言われます。説明が面倒くさくなったので
mapnik/mapnik#3274
に丸投げしますが、そういうことです。