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

Kevin Harwell (JIRA) noreply at issues.asterisk.org
Tue Apr 17 09:33:51 CDT 2018


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27629?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kevin Harwell updated ASTERISK-27629:
-------------------------------------

    Assignee: Alexander Traud  (was: Unassigned)

> [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: DragonFly BSD 5.0.2 with GCC 5.4.1 (default)
> FreeBSD 11.1 with clang 4.0 (default)
>            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