[vlc-devel] [PATCH] vlc_common: include <assert.h>
remi at remlab.net
Wed Mar 15 15:07:07 CET 2017
On mercredi 15 mars 2017 14:25:31 EET Filip Roséen wrote:
> 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>
> > >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.
> 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>`.
I would personally prefer that they don't.
> With your message in mind I will submit a patch-batch with fixes for
> these cases instead of touching `vlc_common.h`.
More information about the vlc-devel