[Home]

Summary:ASTERISK-25591: [patch] Complete List of Header Files (#include): iwyu
Reporter:Alexander Traud (traud)Labels:
Date Opened:2015-11-25 07:29:06.000-0600Date Closed:2015-12-03 05:54:44.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Core/BuildSystem
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) iwyu.patch
Description:Recently, I had to add a new module. Therefore, I had to list all its header files. Thanks to the Clang support added in May 2015, one can use the Google project include-what-you-use ([iwyu|http://include-what-you-use.org/]) with Asterisk now.

For example, in Ubuntu 14.04 LTS:
{{sudo apt-get -y install build-essential libssl-dev libncurses-dev libnewt-dev libxml2-dev libsqlite3-dev uuid-dev libjansson-dev libblocksruntime-dev git iwyu}}
{{cd /usr/src/}}
{{git clone http://gerrit.asterisk.org/asterisk}}
{{cd asterisk/}}
{{./configure}}
{{make}}
{{include-what-you-use -fblocks -DAST_MODULE=NULL -DAST_MODULE_SELF=NULL -I$PWD/include res/res_format_attr_opus.c}}

Asterisk uses the two proxy/wrapper headers {{asterisk/compat.h}} and {{asterisk/astmm.h}} which should never be included. Instead, {{asterisk.h}} should be used. To automate this, I had to add three [pragma statements|http://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md]. With the attached patch, iwyu works out of the box. If more headers should never be included, Asterisk team, please say so!

Thanks to iwyu, the list of header files was a simple copy-and-paste experience. Hopefully, this helps others to create better lists of header files, too. Therefore, please, consider this change/feature for inclusion.
Comments: