Opened 5 years ago

Closed 5 years ago

#59676 closed defect (fixed)

cuneiform: @1.1.0_6 error: non-constant-expression cannot be narrowed from type 'uint32_t'

Reported by: kencu (Ken) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: cuneiform

Description

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

Change History (1)

comment:1 Changed 5 years ago by kencu (Ken)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.