Re: [PATCH] Do not make trace.c/getnanotime an inlined function
Am 28.09.2014 um 09:50 schrieb Ben Walton:
Show 24 quoted lines
> Oracle Studio compilers don't allow for static variables in functions
> that are defined to be inline. GNU C does permit this. Let's reference
> the C99 standard though, which doesn't allow for inline functions to
> contain modifiable static variables.
>
> Signed-off-by: Ben Walton <bdwalton@gmail.com>
> ---
> trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/trace.c b/trace.c
> index b6f25a2..4778608 100644
> --- a/trace.c
> +++ b/trace.c
> @@ -385,7 +385,7 @@ static inline uint64_t gettimeofday_nanos(void)
> * Returns nanoseconds since the epoch (01/01/1970), for performance tracing
> * (i.e. favoring high precision over wall clock time accuracy).
> */
> -inline uint64_t getnanotime(void)
> +uint64_t getnanotime(void)
> {
> static uint64_t offset;
> if (offset > 1) {
> But then the function could stay static, no?
-- Hannes