[MacPorts] #59676: cuneiform: @1.1.0_6 error: non-constant-expression cannot be narrowed from type 'uint32_t'

MacPorts noreply at macports.org
Tue Nov 12 05:09:05 UTC 2019


#59676: cuneiform: @1.1.0_6 error: non-constant-expression cannot be narrowed from
type 'uint32_t'
--------------------+-----------------------
 Reporter:  kencu   |      Owner:  (none)
     Type:  defect  |     Status:  new
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  cuneiform
--------------------+-----------------------
 building with clang-9.0, that defaults to c++17:

 {{{
 /opt/local/var/macports/build/_opt_macports-
 ports_textproc_cuneiform/cuneiform/work/cuneiform-
 linux-1.1.0/cuneiform_src/Kern/cimage/sources/main/cticontrol.cpp:1599:29:
 error: non-constant-expression cannot be narrowed from type 'uint32_t'
 (aka 'unsigned int') to 'int32_t' (aka 'int') in initializer list
 [-Wc++11-narrowing]
         CIMAGE_Rect cRectAllDIB = {wXb, wYb, wXe - wXb, wYe - wYb};
                                    ^~~
 /opt/local/var/macports/build/_opt_macports-
 ports_textproc_cuneiform/cuneiform/work/cuneiform-
 linux-1.1.0/cuneiform_src/Kern/cimage/sources/main/cticontrol.cpp:1599:29:
 note: insert an explicit cast to silence this issue
         CIMAGE_Rect cRectAllDIB = {wXb, wYb, wXe - wXb, wYe - wYb};
                                    ^~~
                                    static_cast<int32_t>( )
 /opt/local/var/macports/build/_opt_macports-
 ports_textproc_cuneiform/cuneiform/work/cuneiform-
 linux-1.1.0/cuneiform_src/Kern/cimage/sources/main/cticontrol.cpp:1599:34:
 error: non-constant-expression cannot be narrowed from type 'uint32_t'
 (aka 'unsigned int') to 'int32_t' (aka 'int') in initializer list
 [-Wc++11-narrowing]
         CIMAGE_Rect cRectAllDIB = {wXb, wYb, wXe - wXb, wYe - wYb};
                                         ^~~
 /opt/local/var/macports/build/_opt_macports-
 ports_textproc_cuneiform/cuneiform/work/cuneiform-
 linux-1.1.0/cuneiform_src/Kern/cimage/sources/main/cticontrol.cpp:1599:34:
 note: insert an explicit cast to silence this issue
         CIMAGE_Rect cRectAllDIB = {wXb, wYb, wXe - wXb, wYe - wYb};
                                         ^~~
                                         static_cast<int32_t>( )
 4 warnings and 2 errors generated.
 }}}

 one way to fix it is to set the c++ standard lower in the Portfile, like
 this:
 {{{
 configure.cxxflags-append -std=c++03
 }}}

-- 
Ticket URL: <https://trac.macports.org/ticket/59676>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list