Navigation Menu

Skip to content

Commit

Permalink
clang: suppress a warning
Browse files Browse the repository at this point in the history
Define missing _GNU_SOURCE for mkostemp().

    lib/ii.c:7217:30: warning: implicit declaration
          of function 'mkostemp' is invalid in C99 [-Wimplicit-function-declaration]
              ii_buffer->tmpfd = GRN_MKOSTEMP(ii_buffer->tmpfpath,
                                 ^
    lib/groonga_in.h:523:45: note: expanded from
          macro 'GRN_MKOSTEMP'
    #  define GRN_MKOSTEMP(template,flags,mode) mkostemp(template,flags)
                                                ^
  • Loading branch information
kou committed Jun 11, 2013
1 parent ba4f11d commit 4231375
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -91,6 +91,10 @@ add_definitions(
-DHAVE_CONFIG_H
)

if(CMAKE_COMPILER_IS_GNUC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
set(_GNU_SOURCE TRUE)
endif()

include_directories(
BEFORE
${CMAKE_CURRENT_BINARY_DIR}
Expand Down
4 changes: 3 additions & 1 deletion config.h.cmake
Expand Up @@ -58,7 +58,9 @@

/* compiler specific build options */
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
#cmakedefine _GNU_SOURCE
#ifndef _GNU_SOURCE
#cmakedefine _GNU_SOURCE
#endif
#cmakedefine _ISOC99_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _NETBSD_SOURCE
Expand Down

0 comments on commit 4231375

Please sign in to comment.