[Asterisk-code-review] headers: Replace typeof with typeof . (asterisk[master])
Corey Farrell
asteriskteam at digium.com
Sun Jan 28 13:30:22 CST 2018
Corey Farrell has posted comments on this change. ( https://gerrit.asterisk.org/8061 )
Change subject: headers: Replace typeof with __typeof__.
......................................................................
Patch Set 1:
> The usage of typeof is not recommended by GCC within headers. We
> should avoid that for sure. Asterisk should be a good role model. I
> see no reason why that should block this review.
The Asterisk README states that we require a compiler with GCC extensions. This applies to modules as well. The GCC documentation you linked on the issue mentions "general-purpose header file". None of the Asterisk headers are general purpose, they are for Asterisk only. Since we require GCC extensions I feel it is not a bug for Asterisk to use GCC extensions in the headers.
Something is disabling GCC extensions and that is the actual bug. I'm suspecting net-snmp in FreeBSD is telling us to add -std=c99 or similar to CFLAGS. This is why I asked for your makeopts and noisy build so we can find out why res_snmp is misbehaving.
Two specific reasons I don't want this change: consistency and readability. In master we use typeof in 94 lines of header files, none of them currently use __typeof__. In addition I feel that __typeof__ is less readable so I'm not thrilled about the idea of using it.
--
To view, visit https://gerrit.asterisk.org/8061
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0d7a2c62ed256cca19a50340e3c337567ac78e58
Gerrit-Change-Number: 8061
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Comment-Date: Sun, 28 Jan 2018 19:30:22 +0000
Gerrit-HasComments: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180128/a658b2da/attachment.html>
More information about the asterisk-code-review
mailing list