diff --git a/CMakeLists.txt b/CMakeLists.txt index 6085865..638b572 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,5 +52,5 @@ install(DIRECTORY ${INCLUDE_DIR}/ DESTINATION include) if(MSVC) target_compile_options(${PROJECT_NAME} PRIVATE /W4 /permissive-) else() - target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-newline-eof) + target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -pedantic -Werror -Wno-newline-eof -Wno-language-extension-token) endif() diff --git a/src/dcfg.c b/src/dcfg.c index a1ccec6..0c72223 100644 --- a/src/dcfg.c +++ b/src/dcfg.c @@ -26,15 +26,12 @@ #ifdef DCFG_PTHREAD_SUPPORT # include #else -# ifdef __USE_POSIX199506 -# undef __USE_POSIX199506 -# endif -# ifdef __USE_UNIX98 -# undef __USE_UNIX98 -# endif +# if defined __USE_POSIX199506 || defined __USE_UNIX98 +# else typedef struct { int unused; } pthread_mutex_t; +# endif void pthread_mutex_init(pthread_mutex_t *, void *); void pthread_mutex_destroy(pthread_mutex_t *); @@ -1073,7 +1070,8 @@ Value *ast_to_value(dcfg_Instance *instance, AST *root) dcfg_Value *dcfg_parse(dcfg_Instance *instance, dcfg_StringView const file_path) { - char path_buf[file_path.size + 1] = {}; + char path_buf[file_path.size + 1]; + memset(path_buf, 0, sizeof(path_buf)); memcpy(path_buf, file_path.data, file_path.size); char *abs = instance->realpath(path_buf);