Summary: | ASTERISK-27156: Asterisk won't compile on Fedora 26 with devmode enabled. | ||||||||||||||
Reporter: | Corey Farrell (coreyfarrell) | Labels: | |||||||||||||
Date Opened: | 2017-07-25 15:49:32 | Date Closed: | 2017-08-02 12:09:18 | ||||||||||||
Priority: | Minor | Regression? | |||||||||||||
Status: | Closed/Complete | Components: | Core/BuildSystem | ||||||||||||
Versions: | 13.17.0 14.6.0 GIT | Frequency of Occurrence | |||||||||||||
Related Issues: |
| ||||||||||||||
Environment: | Attachments: | ||||||||||||||
Description: | 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}}. | ||||||||||||||
Comments: | By: Asterisk Team (asteriskteam) 2017-07-25 15:49:33.348-0500 Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report. Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process]. |