[asterisk-bugs] [JIRA] (ASTERISK-27903) menuselect: GCC 8: restrict-qualified parameter passed and aliased.
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Thu Jun 7 07:45:54 CDT 2018
Alexander Traud created ASTERISK-27903:
------------------------------------------
Summary: menuselect: GCC 8: restrict-qualified parameter passed and aliased.
Key: ASTERISK-27903
URL: https://issues.asterisk.org/jira/browse/ASTERISK-27903
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Core/BuildSystem
Affects Versions: 15.4.0, 13.21.0
Environment: GCC 8.1
Reporter: Alexander Traud
This is a follow-up to ASTERISK-27824. In Fedora 28, the compiler GCC 8.1.1 gives:{code}menuselect_curses.c: In function 'display_mem_info':
menuselect_curses.c:230:12: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
sprintf(buf, "%s%*.*s%s", buf, new_line ? 0 : 1, new_line ? 0 : 1, " ", word);
^~~ ~~~{code}This is because [man sprintf|http://manpages.ubuntu.com/manpages/bionic/man3/sprintf.3.html], section Note:{quote}Some programs imprudently rely on code such as the following
sprintf(buf, "%s some further text", buf);
to append text to buf. However, the standards explicitly note that the results are undefined if source and destination buffers overlap when calling sprintf(), snprintf(), vsprintf(), and vsnprintf().{quote}Thanks to [dcb314|https://github.com/dyne/frei0r/issues/22] for documenting this. Hopefully, someone is going to fix this.
Warnings in Menuselect do not get to an Error even with Developer Mode enabled. Furthermore, I do not use that piece of code, normally. So it does not block me personally.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list