Skip to content

Commit

Permalink
Remove all #define _GNU_SOURCE in source files
Browse files Browse the repository at this point in the history
This is unnecessary since we are using AC_USE_SYSTEM_EXTENSIONS in
configure.ac, which makes the compiler always run with -D_GNU_SOURCE=1
when building for GNU/Linux.

Also, the  #define _GNU_SOURCE  in src/util.c, and in
src/inject_errors.c (--enable-inject-errors), were not guarded by a
#ifndef _GNU_SOURCE  so they were just triggering redefinition warnings.
  • Loading branch information
emanuele6 authored Jul 24, 2023
1 parent cf3c11b commit 8a4f246
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions src/builtin.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#ifndef __sun__
# define _XOPEN_SOURCE
# define _XOPEN_SOURCE_EXTENDED 1
Expand Down
3 changes: 0 additions & 3 deletions src/compile.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE // for strdup
#endif
#include <assert.h>
#include <math.h>
#include <string.h>
Expand Down
2 changes: 0 additions & 2 deletions src/inject_errors.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

#define _GNU_SOURCE /* for RTLD_NEXT */
#include <assert.h>
#include <dlfcn.h>
#include <errno.h>
Expand Down
5 changes: 0 additions & 5 deletions src/util.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@

#ifdef HAVE_MEMMEM
#define _GNU_SOURCE
#endif

#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
Expand Down

0 comments on commit 8a4f246

Please sign in to comment.