Skip to content

Commit

Permalink
Use -std=gnu11 for C
Browse files Browse the repository at this point in the history
  • Loading branch information
sloede committed Aug 28, 2023
1 parent 8ac2b06 commit 60f8d04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ target_link_libraries( ${PROJECT_NAME} PRIVATE ${JULIA_LIBRARY} MPI::MPI_C )
# Set appropriate compile flags
target_compile_options( ${PROJECT_NAME} PUBLIC "-fPIC" )
target_compile_options( ${PROJECT_NAME} PRIVATE -Wall -Wextra -Werror)
# Require C11 standard for C files
target_compile_options( ${PROJECT_NAME} PRIVATE $<$<COMPILE_LANGUAGE:C>:-std=c11>)
# Require C11 standard with GNU extensions for C files
target_compile_options( ${PROJECT_NAME} PRIVATE $<$<COMPILE_LANGUAGE:C>:-std=gnu11>)
# Require Fortran 2018 standard for Fortran files
target_compile_options( ${PROJECT_NAME} PRIVATE $<$<COMPILE_LANGUAGE:Fortran>:-std=f2018>)

Expand Down
17 changes: 2 additions & 15 deletions src/auxiliary.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
// Include first since it includes julia.h, for which we do not want to mess with the
// macro definitions
#include "auxiliary.h"

// Enable support for `setenv`
#ifdef _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
#endif
#define _POSIX_C_SOURCE 200112L

// Enable support for `realpath`
#ifndef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE
#endif

#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

#include "auxiliary.h"


// Default depot path *relative* to the project directory
// OBS! If you change the value here, you should also update the default value of
Expand Down

0 comments on commit 60f8d04

Please sign in to comment.