[libcutl-users] Cygwin64 cutl/details/boost/regex [-Wnarrowing] problem

Feiyun Wang feiyunw at yahoo.com
Sat May 19 05:58:57 EDT 2018


Hi,

I was building libcutl (git SHA-1: bfe21ef, 2018/5/4) with the latest Cygwin64.
Execute "make" command and answering ENTER to all questions, it yields:
````
c++ /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/src/instances.cxx
In file included from /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/regex_traits.hpp:39:0,
                 from /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/regex_traits.hpp:27,
                 from /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/regex.hpp:39,
                 from /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex.hpp:31,
                 from /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/src/instances.cxx:30:
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/cpp_regex_traits.hpp: In instantiation of 'void cutl_details_boost::re_detail::cpp_regex_traits_implementation<charT>::init() [with charT = char]':
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/instances.hpp:149:64:   required from here
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/cpp_regex_traits.hpp:730:7: error: narrowing conversion of '-105' from 'std::ctype_base::mask {aka char}' to 'cutl_details_boost::re_detail::cpp_regex_traits_implementation<char>::char_class_type {aka unsigned int}' inside { } [-Wnarrowing]
       };
       ^
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/cpp_regex_traits.hpp: In instantiation of 'cutl_details_boost::re_detail::cpp_regex_traits_implementation<charT>::char_class_type cutl_details_boost::re_detail::cpp_regex_traits_implementation<charT>::lookup_classname_imp(const charT*, const charT*) const [with charT = char; cutl_details_boost::re_detail::cpp_regex_traits_implementation<charT>::char_class_type = unsigned int]':
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/instances.hpp:152:138:   required from here
/cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/v4/cpp_regex_traits.hpp:796:4: error: narrowing conversion of '-105' from 'std::ctype_base::mask {aka char}' to 'cutl_details_boost::re_detail::cpp_regex_traits_implementation<char>::char_class_type {aka unsigned int}' inside { } [-Wnarrowing]
    };
    ^
make: *** [/usr/local/include/build-0.3/cxx/gnu/cxx-o.make:24: /cygdrive/d/prj/odb/libcutl/cutl/details/boost/regex/src/instances.o] Error 1
````

To fix this, I should set g++ compiler option -Wno-narrowing for the original "make" like:
````
Please enter any extra C++ compiler options.

[]: -Wno-narrowing
````

I have no knowledge about libcutl internals, so I suggest you to fix the source, or add a default C++ compiler option "-Wno-narrowing" as a temporary workaround.




BTW, my toolset versions:
````
$ gcc --version
gcc (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ g++ --version
g++ (GCC) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ make --version
GNU Make 4.2.1
Built for x86_64-unknown-cygwin
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
````

Sincerely,
Feiyun Wang




More information about the libcutl-users mailing list