Skip to content

Commit 3a1e4a9

Browse files
ij-intelshuahkh
authored andcommitted
selftests/resctrl: Move _GNU_SOURCE define into Makefile
_GNU_SOURCE is defined in resctrl.h. Defining _GNU_SOURCE has a large impact on what gets defined when including headers either before or after it. This can result in compile failures if .c file decides to include a standard header file before resctrl.h. It is safer to define _GNU_SOURCE in Makefile so it is always defined regardless of in which order includes are done. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Tested-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Reviewed-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com> Cc: <stable@vger.kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 030b48f commit 3a1e4a9

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

tools/testing/selftests/resctrl/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
22

3-
CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2
3+
CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE
44
CFLAGS += $(KHDR_INCLUDES)
55

66
TEST_GEN_PROGS := resctrl_tests

tools/testing/selftests/resctrl/resctrl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#define _GNU_SOURCE
32
#ifndef RESCTRL_H
43
#define RESCTRL_H
54
#include <stdio.h>

0 commit comments

Comments
 (0)