[vlc-devel] [PATCH] vlc_common: include <assert.h>

Filip Roséen filip at atch.se
Wed Mar 15 14:25:31 CET 2017


Hi Rémi,

On 2017-03-15 14:49, Rémi Denis-Courmont wrote:

> On March 15, 2017 11:07:57 AM GMT+02:00, "Filip Roséen" <filip at atch.se> wrote:
>
> >Given that vlc_assert_unreachable relies on assert from <assert.h>,
> >this header should be included in order to simplify usage of the
> >macro.
>
> I disagree. It is bad practice to include headers in headers, as it
> makes for sloppy code and harder revectoring. Especially when you
> don't need it. BSD style is even more extreme: you have to include
> necessary headers before dependent headers. So this situation is not
> really exceptional.
> 
> That is also the point in using a macro rather than an a static
> inline.

Noted.

I do not care too much about this particular issue, but I noticed
translation-units that makes use `vlc_assert_unreachable`, while
relying on *indirect* includes of `<assert.h>`.

With your message in mind I will submit a patch-batch with fixes for
these cases instead of touching `vlc_common.h`.

Best Regards,\
Filip Roséen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170315/463ae826/attachment.html>


More information about the vlc-devel mailing list