Add back _POSIX_C_SOURCE

I had removed these before the public open source release based on Flexelint output,
but Geoff is correct that, contrary to the C version macros like __STDC_VERSION__,
_POSIX_C_SOURCE is to be set by the programmer.

Ref: https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html

On the downside, we do now see some noise from flexelint and it is unclear to me
how to suppress Note 9071.

--- Module:   pesi.c (C)
File pesi.c, Line 33
        _
    Note 9071: defined macro '_POSIX_C_SOURCE' is reserved to the compiler
File /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h, Line 23
                      _
  long int __tm_gmtoff;		/* Seconds east of UTC.  */
    Error 114: Inconsistent structure declaration for tag 'tm'
File /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h, Line 24
                       _
  const char *__tm_zone;	/* Timezone abbreviation.  */
    Error 114: Inconsistent structure declaration for tag 'tm'

--- Module:   vdp_pesi.c (C)
File vdp_pesi.c, Line 33
        _
    Note 9071: defined macro '_POSIX_C_SOURCE' is reserved to the compiler
File /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h, Line 23
                      _
  long int __tm_gmtoff;		/* Seconds east of UTC.  */
    Error 114: Inconsistent structure declaration for tag 'tm'
File /usr/include/x86_64-linux-gnu/bits/types/struct_tm.h, Line 24
                       _
  const char *__tm_zone;	/* Timezone abbreviation.  */
    Error 114: Inconsistent structure declaration for tag 'tm'
parent b2ae436e
......@@ -29,6 +29,9 @@
* PESI per request state and task management
*/
/* for SSIZE_MAX */
#define _POSIX_C_SOURCE 200809L
#include "config.h"
#include <string.h>
......
......@@ -29,6 +29,9 @@
* Implementation inspired by Varnish cache_esi_deliver.c
*/
/* for SSIZE_MAX */
#define _POSIX_C_SOURCE 200809L
#include "config.h"
#include <stdlib.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment