Package: newsboat
Version: 2.21-1.5
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu lunar ubuntu-patch

Hi Nikos,

In Ubuntu, we've found that newsboat fails to build from source in some
environments because passing -Werror -Wall, gcc cannot detect that a
particular pointer won't be used before initialization:

[...]
In member function ‘__dt_base ’,
    inlined from ‘fetch_feed’ at src/ocnewsapi.cpp:288:1:
/usr/include/c++/12/bits/unique_ptr.h:396:24: error: ‘response’ may be used 
uninitialized [-Werror=maybe-uninitialized]
  396 |           get_deleter()(std::move(__ptr));
      |                        ^
src/ocnewsapi.cpp: In member function ‘fetch_feed’:
src/ocnewsapi.cpp:202:22: note: ‘response’ was declared here
  202 |         json_object* response;
      |                      ^
lto1: all warnings being treated as errors
make[3]: *** [/tmp/cc4iQyn6.mk:218: /tmp/cctiXKcc.ltrans72.ltrans.o] Error 1
[...]

This is probably only an issue when building with LTO enabled as well.

Anyway, it's a false-positive and rather than spending more than 2 seconds
thinking about pointers in C++, I patched the package in Ubuntu to skip this
particular warning flag.  Please see the attached patch for your consideration.

Thanks,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru newsboat-2.21/debian/rules newsboat-2.21/debian/rules
--- newsboat-2.21/debian/rules  2022-09-13 12:56:30.000000000 -0700
+++ newsboat-2.21/debian/rules  2023-03-28 23:12:10.000000000 -0700
@@ -2,6 +2,7 @@
 #export DH_VERBOSE=1
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+export DEB_CXXFLAGS_MAINT_APPEND = -Wno-error=maybe-uninitialized
 DPKG_EXPORT_BUILDFLAGS = 1
 include /usr/share/dpkg/buildflags.mk
 

Reply via email to