Checking that a header file is self-sufficient

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Checking that a header file is self-sufficient

Boost - Build mailing list
Hi,

I think I've seen somebody (presumably Rene) posted jam code for
checking that a header file is self-sufficient. I can't find it
anywhere. Could somebody please send it to me again?

Thanks.
_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Checking that a header file is self-sufficient

Boost - Build mailing list
AMDG

On 09/30/2017 11:52 AM, Mikhail Strelnikov via Boost-build wrote:
>
> I think I've seen somebody (presumably Rene) posted jam code for
> checking that a header file is self-sufficient. I can't find it
> anywhere. Could somebody please send it to me again?
>

You just have to compile a source file that #includes the header.

This is one that I wrote a long time ago:
https://github.com/boostorg/units/blob/develop/test_headers/Jamfile.v2

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Checking that a header file is self-sufficient

Boost - Build mailing list


On 30/09/2017 19:19, Steven Watanabe via Boost-build wrote:
> AMDG
>
> On 09/30/2017 11:52 AM, Mikhail Strelnikov via Boost-build wrote:
>> I think I've seen somebody (presumably Rene) posted jam code for
>> checking that a header file is self-sufficient. I can't find it
>> anywhere. Could somebody please send it to me again?
>>
> You just have to compile a source file that #includes the header.

Don't you need to actually instantiate the templates (if any) as well? 
Otherwise errors in unused code may well go unchecked if there are ADL
calls.

---
This email has been checked for viruses by AVG.
http://www.avg.com

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build
Reply | Threaded
Open this post in threaded view
|

Re: Checking that a header file is self-sufficient

Boost - Build mailing list
AMDG

On 09/30/2017 12:23 PM, John Maddock via Boost-build wrote:

>
> On 30/09/2017 19:19, Steven Watanabe via Boost-build wrote:
>> On 09/30/2017 11:52 AM, Mikhail Strelnikov via Boost-build wrote:
>>> I think I've seen somebody (presumably Rene) posted jam code for
>>> checking that a header file is self-sufficient. I can't find it
>>> anywhere. Could somebody please send it to me again?
>>>
>> You just have to compile a source file that #includes the header.
>
> Don't you need to actually instantiate the templates (if any) as well?
> Otherwise errors in unused code may well go unchecked if there are ADL
> calls.
>

  True enough, but compiling the header is about
the best you can do while still having it fully
automated.  To instantiate templates, you actually
have to know something about what the code does.

In Christ,
Steven Watanabe

_______________________________________________
Unsubscribe & other changes: https://lists.boost.org/mailman/listinfo.cgi/boost-build