Coder Social home page Coder Social logo

Comments (8)

srz-zumix avatar srz-zumix commented on June 2, 2024 1

再現手順ありがとうございます。原因と修正方法を調べていきます。
とりあえずビルドを通すのであれば、 -DIUTEST_HAS_HDR_UCHAR=0 を追加して明示的に uchar.h を使わないようにできます。

from iutest.

yumetodo avatar yumetodo commented on June 2, 2024

./mingw64/x86_64-w64-mingw32/include/uchar.h

/* Remember that g++ >= 4.4 defines these types only in c++0x mode */
#if !(defined(__cplusplus) && defined(__GXX_EXPERIMENTAL_CXX0X__)) ||   \
    !defined(__GNUC__) ||                       \
    (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4))
typedef uint_least16_t char16_t;
typedef uint_least32_t char32_t;
#endif
$ clang++ -dM -std=c++1z -E -x c++ /dev/null | grep cplus
#define __cplusplus 201406L
$ clang++ -dM -std=c++1z -E -x c++ /dev/null | grep GXX
#define __GXX_ABI_VERSION 1002
#define __GXX_EXPERIMENTAL_CXX0X__ 1
#define __GXX_RTTI 1
#define __GXX_WEAK__ 1
$ clang++ -dM -std=c++1z -E -x c++ /dev/null | grep GNUC
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC__ 4
$ clang++ -dM -std=c++1z -fno-ms-compatibility -E -x c++ /dev/null | grep cplus
#define __cplusplus 201406L
$ clang++ -dM -std=c++1z -fno-ms-compatibility -E -x c++ /dev/null | grep GXX
#define __GXX_ABI_VERSION 1002
#define __GXX_EXPERIMENTAL_CXX0X__ 1
#define __GXX_RTTI 1
#define __GXX_WEAK__ 1
$ clang++ -dM -std=c++1z -fno-ms-compatibility -E -x c++ /dev/null | grep GNU
#define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
#define __GNUC_PATCHLEVEL__ 1
#define __GNUC__ 4
#define __GNUG__ 4

どうも__GNUC__ == 4 && __GNUC_MINOR__ < 4に引っかかっている様子。これはmingw側の問題か

from iutest.

yumetodo avatar yumetodo commented on June 2, 2024
// include
#include "../internal/iutest_charcode.hpp"
#if IUTEST_HAS_HDR_UCHAR && !(defined(__MINGW32__) && defined(__GNUC__) && defined(__clang__))
#  include <uchar.h>
#endif

とかしておけばとりあえず回避できそうではあるが、mingw clangでchar16_tchar32_tがビルトインされたのいつだったろうか。

from iutest.

srz-zumix avatar srz-zumix commented on June 2, 2024

uchar.h ではなく cuchar ヘッダーを使うように変更しました。
再現環境ではエラーが出ないようになりました。

from iutest.

yumetodo avatar yumetodo commented on June 2, 2024

手元ではエラーは出なくなりました。

ところで例えばwandboxのclangだとcucharはなかったりするんですが、大丈夫ですか?

from iutest.

srz-zumix avatar srz-zumix commented on June 2, 2024

cuchar は char16_t/char32_t 文字列を人が読める出力に変換するためにインクルードしているのですが、 codecvt が使える場合はそちらを優先的に使います。
影響範囲としては、 codecvt が使えないケース、かつ、 char16_t/char32_t 文字列をテストに利用している場合に限られるので、狭いと思っています。

実は、この辺のコードはあんまりテスト、動作確認してなくて怪しかったりします…
なので、今回は機能が使えることよりもコンパイルが通ることを優先して修正しました。

文字コード関係の対応をしっかりするときに、見直したいと思います。

from iutest.

yumetodo avatar yumetodo commented on June 2, 2024

文字コードは闇しか無いですからねぇ・・・。そもそもmingwの場合char以外使えないに等しかったりしますし、localeは控えめに言って腐ってますし・・・。

ではcloseします。

from iutest.

yumetodo avatar yumetodo commented on June 2, 2024

upstreamで修正入ったぽい。

https://github.com/Alexpux/MINGW-packages/issues/1541#issuecomment-254239608

Fix commited upstream https://sourceforge.net/p/mingw-w64/mingw-w64/ci/1a9621b7348db058b8d76dd64cb0269f9d998aa5/

from iutest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.