[asterisk-bugs] [JIRA] (ASTERISK-27156) Asterisk won't compile on Fedora 26 with devmode enabled.
Corey Farrell (JIRA)
noreply at issues.asterisk.org
Tue Jul 25 15:49:58 CDT 2017
Corey Farrell created ASTERISK-27156:
----------------------------------------
Summary: Asterisk won't compile on Fedora 26 with devmode enabled.
Key: ASTERISK-27156
URL: https://issues.asterisk.org/jira/browse/ASTERISK-27156
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Core/BuildSystem
Affects Versions: 14.6.0, 13.17.0, GIT
Reporter: Corey Farrell
Severity: Minor
It looks like gcc 7 includes a {{format-truncation}} warning which becomes an error in devmode. The error occurs in many files, the following is from main/asterisk.c:
{noformat}
gcc -o /dev/null -c asterisk.i -pthread -I/home/cfarrell/code/asterisk/master/include -I/usr/include/libxml2 -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -Werror -Wunused -Wdeclaration-after-statement -Wtrampolines -Wundef -Wmissing-format-attribute -Wformat=2 -O0 -march=native -I. -Ieditline -DAST_MODULE=\"core\" -DAST_IN_CORE -O3
asterisk.c: In function ‘ast_readconfig’:
asterisk.c:3511:65: error: ‘/monitor’ directive output may be truncated writing 8 bytes into a region of size between 1 and 4096 [-Werror=format-truncation=]
snprintf(cfg_paths.monitor_dir, sizeof(cfg_paths.monitor_dir), "%s/monitor", cfg_paths.spool_dir);
^~~~~~~~~~~~
asterisk.c:3511:2: note: ‘snprintf’ output between 9 and 4104 bytes into a destination of size 4096
snprintf(cfg_paths.monitor_dir, sizeof(cfg_paths.monitor_dir), "%s/monitor", cfg_paths.spool_dir);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asterisk.c:3512:69: error: ‘/recording’ directive output may be truncated writing 10 bytes into a region of size between 1 and 4096 [-Werror=format-truncation=]
snprintf(cfg_paths.recording_dir, sizeof(cfg_paths.recording_dir), "%s/recording", cfg_paths.spool_dir);
^~~~~~~~~~~~~~
asterisk.c:3512:2: note: ‘snprintf’ output between 11 and 4106 bytes into a destination of size 4096
snprintf(cfg_paths.recording_dir, sizeof(cfg_paths.recording_dir), "%s/recording", cfg_paths.spool_dir);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [/home/cfarrell/code/asterisk/master/Makefile.rules:135: asterisk.o] Error 1
make[1]: Leaving directory '/home/cfarrell/code/asterisk/master/main'
make: *** [Makefile:367: main] Error 2
{noformat}
I receive this error with all modes of {{DONT_OPTIMIZE}} and {{DOUBLE_COMPILE}}.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list