[asterisk-bugs] [JIRA] (ASTERISK-27903) menuselect: GCC 8: restrict-qualified parameter passed and aliased.

Friendly Automation (JIRA) noreply at issues.asterisk.org
Wed Jun 20 15:30:54 CDT 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243873#comment-243873 ] 

Friendly Automation commented on ASTERISK-27903:
------------------------------------------------

Change 9202 merged by Jenkins2:
menuselect/menuselect_curses: Resolves sprintf usage error

[https://gerrit.asterisk.org/9202|https://gerrit.asterisk.org/9202]

> 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