Skip to content

benchmark: use fallback gettime provided by Gnulib's timespec module

Daiki Ueno requested to merge dueno/gnutls:wip/dueno/benchmark-gettime into master

If CLOCK_PROCESS_CPUTIME_ID is not defined, a fallback gettime function was defined as an inline function. Given that "timespec.h" from Gnulib already defines such a fallback function with the same name, it's not necessary to redefine it. This should fix the build issue with Clang:

  In file included from ../../gnutls-3.8.1/src/cli.c:65:
  ../../gnutls-3.8.1/src/benchmark.h:38:20: error: static declaration of 'gettime' follows non-static declaration
  inline static void gettime(struct timespec *ts)
                     ^
  ../../gnutls-3.8.1/src/gl/timespec.h:93:6: note: previous declaration is here
  void gettime (struct timespec *) _GL_ARG_NONNULL ((1));
       ^

Fixes: #1497 (closed)

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • Code modified for feature
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated / NEWS entry present (for non-trivial changes)
  • CI timeout is 2h or higher (see Settings/CICD/General pipelines/Timeout)

Reviewer's checklist:

  • Any issues marked for closing are addressed
  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTION.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code
Edited by Daiki Ueno

Merge request reports