[asterisk-dev] [Code Review] 4370: RAII_VAR: nested functions aren't portable. Adapting RAII_VAR to use clang/llvm blocks to get the same/similar functionality. TAKE 2

Matt Jordan reviewboard at asterisk.org
Thu Feb 19 22:08:13 CST 2015



> On Jan. 25, 2015, 11:36 p.m., Diederik de Groot wrote:
> > /branches/11/include/asterisk/inline_api.h, lines 44-51
> > <https://reviewboard.asterisk.org/r/4370/diff/1/?file=71056#file71056line44>
> >
> >     You might want to check out:
> >         #define forceinline __inline__ __attribute__((always_inline))
> >         #define ensure_forceinline __attribute__((always_inline)) // inline or die
> >     
> >     To see if they would help forcing clang to inline

I gave it a shot, and clang still believes that the functions are re-defined.

There may be a magical invocation to get clang to believe that these inlinings should occur, but I'm not sure what it is.


- Matt


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4370/#review14280
-----------------------------------------------------------


On Jan. 25, 2015, 4:26 p.m., Matt Jordan wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4370/
> -----------------------------------------------------------
> 
> (Updated Jan. 25, 2015, 4:26 p.m.)
> 
> 
> Review request for Asterisk Developers and Diederik de Groot.
> 
> 
> Bugs: ASTERISK-20850
>     https://issues.asterisk.org/jira/browse/ASTERISK-20850
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> This is a continuation of the patch put up for review on r3488. It addresses the issues found on that review.
> 
> This patch *should* make Asterisk compile under clang. Note that compiling with --enable-dev-mode will cause Asterisk to fail to compile under clang, as it detects a number of warnings that aren't fixed under this patch.
> 
> 
> Diffs
> -----
> 
>   /branches/11/makeopts.in 431089 
>   /branches/11/main/Makefile 431089 
>   /branches/11/include/asterisk/utils.h 431089 
>   /branches/11/include/asterisk/inline_api.h 431089 
>   /branches/11/configure.ac 431089 
>   /branches/11/configure UNKNOWN 
>   /branches/11/Makefile 431089 
> 
> Diff: https://reviewboard.asterisk.org/r/4370/diff/
> 
> 
> Testing
> -------
> 
> * Compiled Asterisk with and without --enable-dev-mode using gcc. Asterisk compiles correctly.
> * Compiled Asterisk without --enable-dev-mode using clang. Asterisk compiles, links, and executes.
> 
> Note that you will need the BlocksRuntime to run Asterisk when it is compiled with clang.
> 
> 
> Thanks,
> 
> Matt Jordan
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150220/ca473b24/attachment.html>


More information about the asterisk-dev mailing list