subtitleeditor icon indicating copy to clipboard operation
subtitleeditor copied to clipboard

Fix build with -Wformat-security and -Werror flags (copied from gna.org/bugs/?24958)

Open innir opened this issue 8 years ago • 2 comments

Hi kitone,

I still carry (a now slightly modified) patch to be able to compile on Debian. To not loose track of your effort I opened this bug report now. I post the newest comment here, the whole bug available here: https://web.archive.org/web/20170205222737/http://gna.org/bugs/?24958

You could probably create a separate branch to work on this issue this way others could help easier.

Best, Philip

Wed 14 Sep 2016 06:53:20 PM UTC, comment #8:

Hi, The problem is that the flag option -Wformat-security was added by the distrib. SE build with this options (see configure.ac line 272) :

CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wconversion"

This end with something like this with the override :

CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wconversion -Wformat-security"

This break GST_ELEMENT_WARNING (and others), we can force to disable the flag with this around the code :

...
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-security"

se_debug_message(SE_DEBUG_VIDEO_PLAYER, "failed to gen_audio_element '%s'", ex.what());
GST_ELEMENT_WARNING(m_pipeline->gobj(), RESOURCE, NOT_FOUND, (ex.what()), (NULL));

#pragma GCC diagnostic pop
...

I have start to work on a patch with the flags -Wformat-security and -Werror by default, but this is a lot of work to make the compiler silent... (see the patch)

Sadly, it's hard to find time to work on it this days.

Best regards, kitone

innir avatar Jun 23 '17 09:06 innir

Thanks Philip, Can you check again with the last commit ?

Best regards, kitone

kitone avatar Jun 23 '17 23:06 kitone

Hi kitone,

that should work, it's exactly the patch I'm using in Debian: https://anonscm.debian.org/cgit/collab-maint/subtitleeditor.git/tree/debian/patches/01-fix-build.patch But I wouldn't call it a real fix ;-)

Best, Philip

innir avatar Jun 24 '17 10:06 innir