I wrote: > Pali Rohár <[email protected]> wrote: > >>> Because Microsoft CRT calls `_wassert()`, this looks like a correct >>> direction to move. By default GCC assumes source files are in UTF-8 which >>> has an effect on the encoding of `__FILE__`, so non-ASCII paths in messages >>> might become gibberish. >> >> That is truth. But this is rather general problem of all __FILE__ macro >> usage. Which is in lot of mingw-w64 header files. >> >> This is about "crt: always use _wassert() to implement assert() macro". >> >> Anyway, if you want to forward calls from assert() macro to _wassert() >> function by default, then please at least provide a way to let it >> forward to _assert(), for example by some macro. > > Is there any practical reason why we would want to do that? > > Maybe we could provide helper macros like `_assert_a` and `_assert_w` which > are versions of `assert` which respectively always use `_assert` and > `_wassert`?
Do I understand correctly that you suggest to modify assert.h in a way, that allows to choose whether `assert` is calling `_assert` or `_wassert`? Maybe we could add a feature macro like `__MINGW_USE_NARROW_ASSERT`, which when defined, would result in `assert` calling `_assert`. This macro would work just like `NDEBUG`, so assert.h can be included multiple times in single compilation unit with different `__MINGW_USE_NARROW_ASSERT` setting. The thing is I just cannot see any practical use for it. - Kirill Makurin _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
