[vlc-devel] [PATCH 6/6] vlc_threads: use VLC_ATTR to apply attributes

Filip Roséen filip at atch.se
Sun Feb 26 21:55:53 CET 2017


Hi Rémi,

On 2017-02-26 22:27, Rémi Denis-Courmont wrote:

> >  static
> > -__attribute__((unused))
> > -__attribute__((noinline))
> > -__attribute__((error("sorry, cannot sleep for such short a time")))
> 
> The noinline attribute is required to inhibit optimization and let this 
> function do its magic. And then the unused attribute is required to avoid one 
> warning for each compilation. Finally the error attribute is the very essence 
> of the function.

To be pedantic: the usage of `__attribute__((noinline))` does not make
much sense together with `__attribute__((error("")))` as usage of the
function shall result in a diagnostic, and there is therefor nothing
to inline nor optimized away.

If you are saying that `noinline` is a backup if `error` is ignored on
a, what you considers *"non `__GNUC__` compliant"*, compiler; I do not
see how that plays very well with the previously stated opinions (and
would like to ask for a clarification).

 - https://mailman.videolan.org/pipermail/vlc-devel/2017-February/111763.html

> So overall, I would say that all three attributes are nonoptional. Even if 
> this header were not part of the public out-of-tree set, I would not really 
> get the sense of this patch.

Yes, the introduction of that function does only make sense if the
mentioned attributes are supported by the underlying implementation;
something I was about to address in a follow-up patch before you made
your replies (but you *"nacked"* me before I had a chance to, and now
it does not to matter).

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


More information about the vlc-devel mailing list