[odb-users] "cutl" fails to compile under cygwin with a minor casting issue.

christian montanari ptizoom at gmail.com
Thu Jul 5 07:24:22 EDT 2018


"std::ctype<charT>::print" needs to be cast to "char_class_type" to avoid a sordide sign issue in current cygwin release.
Please see the git diff I used to resolve the compilation error, It might save you the bit of a time to find out it was ::print causing it.

Thx.


commit 8c71cfafcbec8057b68a25c914042071aea49281 (HEAD -> cyg_PTZ180607)
Author: ptizoom <ptizoom at gmail.com>
Date:   Thu Jul 5 12:56:40 2018 +0200

    cutl: enum "std::ctype<charT>::print" is cast to "char_class_type" as under cygwin of the day it seems to be signed

diff --git a/cutl/details/boost/regex/v4/cpp_regex_traits.hpp b/cutl/details/boost/regex/v4/cpp_regex_traits.hpp
index 654f668..0a4d68c 100644
--- a/cutl/details/boost/regex/v4/cpp_regex_traits.hpp
+++ b/cutl/details/boost/regex/v4/cpp_regex_traits.hpp
@@ -718,7 +718,8 @@ void cpp_regex_traits_implementation<charT>::init()
          std::ctype<charT>::graph,
          cpp_regex_traits_implementation<charT>::mask_horizontal,
          std::ctype<charT>::lower,
-         std::ctype<charT>::print,
+         //PTZ180705 this casting avoids error: conversion réductrice de -105 ?! char_class_type should be uint really...
+         (char_class_type) std::ctype<charT>::print,
          std::ctype<charT>::punct,
          std::ctype<charT>::space,
          std::ctype<charT>::upper,
@@ -782,7 +783,8 @@ typename cpp_regex_traits_implementation<charT>::char_class_type
       cpp_regex_traits_implementation<charT>::mask_horizontal,
       std::ctype<char>::lower,
       std::ctype<char>::lower,
-      std::ctype<char>::print,
+//PTZ180705      //ko std::ctype_base::print, casting is better...
+      (char_class_type) std::ctype<char>::print,
       std::ctype<char>::punct,
       std::ctype<char>::space,
       std::ctype<char>::space,
Provenance : Courrier pour Windows 10



More information about the odb-users mailing list