On Mon, Nov 19, 2018 at 01:31:25PM -0500, George Koehler wrote:
> My powerpc machine is using the gcc 6 diff from
> https://marc.info/?l=openbsd-ports&m=154165621429861&w=2
> 
> This is using gcc-6.4.0p2 as ports-gcc, and has now failed to build
> devel/cmake, so it blocks all ports that use cmake.  I don't know who
> to mail, so I am only mailing the list.
> 
> CMake checks that std::make_unique (C++14) and std::unique_ptr (C++11)
> work without compiler warnings.  The second check must pass.  Both
> checks fail because gcc 6 warns when linking any C++ program:
> 
> $ eg++ -o simple simple.cc 
> /usr/local/lib/gcc/powerpc-unknown-openbsd6.4/6.4.0/../../../libestdc++.so.18.0:
>  warning: sprintf() is often misused, please use snprintf()
> 
> I don't have a fix yet, but I have 2 ideas:
>   1. edit CMake's Source/Checks/cm_cxx_features.cmake to ignore the
>      warning, or
>   2. find and fix the evil sprintf() in libestdc++.
> 
> I kept my /usr/ports/pobj/gcc-6.4.0 (with dpb -C).  After my machine
> builds some other packages, I will look for the evil sprintf().  The
> warning annoys me.  Other C++ compilers, like base-gcc on powerpc and
> base-clang on amd64, don't give this warning.

Fwiw, i hit the same issue on sparc64 when testing the gcc6 update, and
its been reported upstream in
https://gitlab.kitware.com/cmake/cmake/issues/18602 - but your analysis
went further it seems. The sprintf comes from OpenBSD's toolchain who
likes to loudly warn you about APIs considered insecure, and iirc
there's no way to disable it via runtime flags.

Landry

Reply via email to