Define _GNU_SOURCE once for whole codebase 39/190539/7
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 3 Oct 2018 11:59:18 +0000 (13:59 +0200)
committerKarol Lewandowski <lmctl@lmctl.net>
Wed, 7 Nov 2018 22:43:39 +0000 (23:43 +0100)
There is no need to repeat this in every file.

Change-Id: Ia788840d819b8d72122296a5e5d64aa2a7c3cb40

CMakeLists.txt
src/crash-manager/crash-manager.c
src/crash-manager/dbus_notify.c
src/crash-stack/CMakeLists.txt
src/crash-stack/crash-stack.c
src/shared/util.c
src/sys-assert/arm/backtrace.c
src/sys-assert/arm_64/backtrace.c
src/sys-assert/sys-assert.c
src/sys-assert/x86/backtrace.c
src/sys-assert/x86/context.c

index 9834ed5574cbe29457694f47129f5afb5161d873..9f3222ddc7802b30f65a882cc3f400bbeba1856c 100644 (file)
@@ -3,7 +3,7 @@ PROJECT(crash-worker C)
 
 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 
-ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64)
+ADD_DEFINITIONS(-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE=1)
 
 # Sub modules
 ADD_SUBDIRECTORY(src/crash-manager)
index 95cbf8bb9757e4eab641de860e3ee52c34bf74b6..c48e29a86974df90eae91e3607867e57c04ac900 100644 (file)
@@ -16,8 +16,6 @@
  * limitations under the License.
  */
 
-#define _GNU_SOURCE
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
index 6a8c5d83131f6ff4ef4fd0d9fd579e4e0b1872c1..cf78f6a8a879f32ad659393120406b21961c7d46 100644 (file)
@@ -16,7 +16,6 @@
  * Author: Mateusz Moscicki <m.moscicki2@partner.samsung.com>
  */
 
-#define _GNU_SOURCE
 #include <gio/gio.h>
 #include <stdio.h>
 #include <unistd.h>
index fd26face329b2cd3b55a9e9212a5c85c999b3d12..f996da9b3a41c46d9954e188616b93c1fb9ff71d 100644 (file)
@@ -21,7 +21,7 @@ else()
   set(CRASH_STACK_SRCS ${CRASH_STACK_SRCS} crash-stack-stub.c)
 endif()
 
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE -D_GNU_SOURCE=1")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIE")
 set(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
 
 # Binary
index a3480676fd8f86a9d05b803a2e6428a1d7c71407..00e2f3fe46fe1079f0817a89e145b68c45b52208 100644 (file)
@@ -17,7 +17,6 @@
  *         Łukasz Stelmach <l.stelmach@samsung.com>
  *         Rafał Pietruch <r.pietruch@samsung.com>
  */
-#define _GNU_SOURCE 1
 
 /**
  * @file crash-stack.c
index 236752499be5f26f9e7b5b83044ab7e8626918fb..775d6beb077ad5b1d6613ad11dbbf29ecf051000 100644 (file)
@@ -14,9 +14,6 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
-#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
index 7520bba2eb3f938df6da72e76d0158d5a49e6630..2d1241a6ae39777b4e2b12a5b41c904ec14fd3ae 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>
index 3c8f560fb7dfc1256682fd0fb1958732328c08a0..21a10d4d0a87e7a24316724a182d89976dded82d 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>
index 75c7c3b3c8d339723e8b383385fbf857f0381354..5af44fff98f9a45fd82e7bd6b0b055c6413a5a5e 100644 (file)
@@ -15,7 +15,6 @@
  * limitations under the License.
  */
 
-#define _GNU_SOURCE
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
index 0453bbb7a8609697a80964241996cff0c98e60a4..4c07d863c9c65089ecb50fb348818c986b36b9ca 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <execinfo.h>
index 5644d1553a428a9832f9729d8f5c0ed64fc07b25..313ad86f6c81ea1339c664dc6705a3723c9bc421 100644 (file)
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-#define _GNU_SOURCE
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <ucontext.h>