[asterisk-bugs] [JIRA] (ASTERISK-27903) menuselect: GCC 8: restrict-qualified parameter passed and aliased.
Joshua Colp (JIRA)
noreply at issues.asterisk.org
Tue Jun 12 07:33:54 CDT 2018
[ https://issues.asterisk.org/jira/browse/ASTERISK-27903?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Joshua Colp updated ASTERISK-27903:
-----------------------------------
Severity: Minor (was: Major)
> 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: 13.21.0, 15.4.0
> Environment: GCC 8.1
> Reporter: Alexander Traud
> Severity: Minor
>
> 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