[asterisk-bugs] [JIRA] (ASTERISK-29576) Scope Tracing: format string is not a string literal

Sean Bright (JIRA) noreply at issues.asterisk.org
Tue Aug 17 09:15:33 CDT 2021


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

Sean Bright commented on ASTERISK-29576:
----------------------------------------

Could just do something like:

{noformat}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wformat-nonliteral"
    ast_log_full(__LOG_TRACE, -1, NULL, 0, NULL, 0, ast_str_buffer(fmt), ap);
#pragma clang diagnostic pop
{noformat}

> Scope Tracing: format string is not a string literal
> ----------------------------------------------------
>
>                 Key: ASTERISK-29576
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29576
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Logging
>    Affects Versions: 16.20.0, 18.6.0
>         Environment: Clang 12.0.0-3 of Ubuntu 21.04
>            Reporter: Alexander Traud
>
> This issue was introduced with [GERRIT-14463|https://gerrit.asterisk.org/14463]. Why ever, the compiler Clang but not GCC is not complaining about this.
> *Steps to Reproduce* (see {{contrib/scripts/install_prereq}}):
> {code}
> sudo apt install make clang libblocksruntime-dev pkg-config
> sudo apt install libedit-dev libjansson-dev libsqlite3-dev uuid-dev libxml2-dev
> CC=clang CXX=clang++ ./configure --enable-dev-mode=noisy
> make
> {code}
> *Result*:
> {code}
> logger.c:2449:50: error: format string is not a string literal [-Werror,-Wformat-nonliteral]
>         ast_log_full(__LOG_TRACE, -1, NULL, 0, NULL, 0, ast_str_buffer(fmt), ap);
>                                                         ^~~~~~~~~~~~~~~~~~~
> {code}Unsure what to do about this. The comments on Gerrit indicate that this code snippet is still under investigation. I could disable this particular error for the file {{./main/logger.c}} in Developer Mode, in general or just for Clang. Any suggestions? Or we ignore this issue because nobody (?) is using Clang with the Developer Mode of Asterisk. Not sure.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list