[vlc-devel] [PATCH 6/6] vlc_threads: use VLC_ATTR to apply attributes
Rémi Denis-Courmont
remi at remlab.net
Sun Feb 26 21:27:35 CET 2017
Le sunnuntaina 26. helmikuuta 2017, 20.13.16 EET Filip Roséen a écrit :
> ---
> include/vlc_threads.h | 20 +++++++++++---------
> 1 file changed, 11 insertions(+), 9 deletions(-)
>
> diff --git a/include/vlc_threads.h b/include/vlc_threads.h
> index 1ee346cc9e..2cba013b6b 100644
> --- a/include/vlc_threads.h
> +++ b/include/vlc_threads.h
> @@ -28,6 +28,8 @@
> #ifndef VLC_THREADS_H_
> #define VLC_THREADS_H_
>
> +#include "vlc_common.h"
> +
> /**
> * \ingroup os
> * \defgroup thread Threads and synchronization primitives
> @@ -832,9 +834,9 @@ VLC_API void msleep(mtime_t delay);
> */
>
> 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.
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.
--
雷米‧德尼-库尔蒙
https://www.remlab.net/
More information about the vlc-devel
mailing list