[asterisk-bugs] [JIRA] (ASTERISK-27629) [patch] headers: Replace typeof with __typeof__.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Sat Feb 17 10:13:13 CST 2018


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

Alexander Traud commented on ASTERISK-27629:
--------------------------------------------

See the comment in the change on Gerrit. Currently, the report is within Asterisk. If somebody likes to report further upstream, to the maintainer of that port in FreeBSD, he is welcome.

> [patch] headers: Replace typeof with __typeof__.
> ------------------------------------------------
>
>                 Key: ASTERISK-27629
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27629
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Core/Portability
>    Affects Versions: 13.19.0, 15.2.0
>         Environment: FreeBSD 11.1 with clang 4.0
>            Reporter: Alexander Traud
>            Assignee: Alexander Traud
>            Severity: Minor
>              Labels: patch
>         Attachments: typeof_in_headers.patch
>
>
> The documentation of GCC [states|http://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html#Alternate-Keywords] one should not use {{typeof}} in header files. Instead, {{\_\_typeof\_\_}} should be used. In Asterisk, {{typeof}} is used 117 times in header files. If {{typeof}} is within a DEFINE and referenced only by C code, {{typeof}} is not really used in a header file because it is eliminated by the preprocessor already. Of these 117, only 4 occasions were identified to be used within a header file itself. 3 were directly used and were found by a text search. 1 occasion (utils.h) is a DEFINE which is then used within the function {{ast_alertpipe_swap(.)}}, which is coded in a header file.
> These issues were found by compiling {{res_snmp.c}} within FreeBSD 11.1 with its default compiler _clang_ 4.0. Although the root cause is quite obvious, uncertainty remains why these errors happened only with the module {{res_snmp.c}}. These headers are included by other modules before. Therefore, something else in the build system must be wrong, because this got obvious only when trying to compile {{res_snmp.c}} and did not happen with clang 4.0 (and clang 5.0) on Debian, Ubuntu, CentOS, or Fedora.
> Workaround: Disable res_snmp via {{menuselect}} or to  remove the package {{net-snmp}} from the installation, for example via {{pkg delete net-snmp}}.



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



More information about the asterisk-bugs mailing list