Opened 13 years ago
Closed 13 years ago
#2986 closed Patches (fixed)
Boost.Filesystem warnings when wchar_t is 16-bit are a problem when warnings are treated as errors
Reported by: | Owned by: | Beman Dawes | |
---|---|---|---|
Milestone: | Boost 1.40.0 | Component: | filesystem |
Version: | Boost 1.38.0 | Severity: | Cosmetic |
Keywords: | warnings wchar_t UCS2 | Cc: |
Description
When wchar_t is 16-bit, some code in Boost.Filesystem can trigger range comparison warnings:
src/libs/detail/utf8_codecvt_facet.cpp:245: warning: comparison is always true due to limited range of data type src/libs/detail/utf8_codecvt_facet.cpp:248: warning: comparison is always true due to limited range of data type src/libs/detail/utf8_codecvt_facet.cpp:251: warning: comparison is always true due to limited range of data type
There is a note near this code that says to ignore these warnings if wchar_t is UCS2 (16-bit), but if the compiler is treating (all) warnings as errors, this is difficult to do automatically.
Something along the lines of the attached patch should allow the code to work properly in both cases. An alternative solution would be to completely remove the specialization if wchar_t is 16-bit (i.e. wrap the whole function in the #ifdef guards).
Attachments (1)
Change History (2)
by , 13 years ago
Attachment: | 52-fix-wchar_t-ucs2.diff added |
---|
comment:1 by , 13 years ago
Milestone: | Boost 1.39.0 → Boost 1.40.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Patch applied. Thanks!
--Beman
Patch showing one way to remove the warnings