Menu

#22 Fix C compatibility issues in the configure script

1.2.11
open
nobody
None
2023-12-19
2023-12-19
No

This is necessary to avoid incorrectly failing probes due to expected compiler errors.

Include <stdlib.h> for the exit function, and <string.h> for the strdup function.

Use fake prototypes to avoid implicit function declarations in the xine_* function probes.

1 Attachments

Discussion

  • Sam James

    Sam James - 2023-12-19

    There's an issue with clock_gettime as well, I think?

    conftest.c:62:9: warning: "_GNU_SOURCE" redefined
       62 | #define _GNU_SOURCE /**/
          |         ^~~~~~~~~~~
    conftest.c:23:9: note: this is the location of the previous definition
       23 | #define _GNU_SOURCE 1
          |         ^~~~~~~~~~~
    conftest.c: In function 'main':
    conftest.c:83:10: error: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
       83 |          clock_gettime(CLOCK_REALTIME, &ts);
          |          ^~~~~~~~~~~~~
    conftest.c:83:10: warning: nested extern declaration of 'clock_gettime' [-Wnested-externs]
    conftest.c:83:24: error: 'CLOCK_REALTIME' undeclared (first use in this function)
       83 |          clock_gettime(CLOCK_REALTIME, &ts);
          |                        ^~~~~~~~~~~~~~
    

    Need #include <time.h>.

     

    Last edit: Sam James 2023-12-19
  • Florian Weimer

    Florian Weimer - 2023-12-19

    Good catch, but that's already not working with any compiler because CLOCK_REALTIME is undefined. We are focusing mostly on regressions, especially with the current instrumentation that suppresses error logging in case of unrelated errors.

     

Log in to post a comment.

MongoDB Logo MongoDB