From patchwork Sat Feb 29 13:46:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jon Turney X-Patchwork-Id: 38357 Received: (qmail 77301 invoked by alias); 29 Feb 2020 13:47:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 77292 invoked by uid 89); 29 Feb 2020 13:47:06 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, FORGED_SPF_HELO, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: re-prd-fep-041.btinternet.com Received: from mailomta12-re.btinternet.com (HELO re-prd-fep-041.btinternet.com) (213.120.69.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 29 Feb 2020 13:47:04 +0000 Received: from re-prd-rgout-003.btmx-prd.synchronoss.net ([10.2.54.6]) by re-prd-fep-041.btinternet.com with ESMTP id <20200229134701.RLAU25931.re-prd-fep-041.btinternet.com@re-prd-rgout-003.btmx-prd.synchronoss.net>; Sat, 29 Feb 2020 13:47:01 +0000 Authentication-Results: btinternet.com; auth=pass (LOGIN) smtp.auth=jonturney@btinternet.com X-OWM-Source-IP: 31.51.207.12 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-VadeSecure-score: verdict=clean score=0/300, class=clean Received: from localhost.localdomain (31.51.207.12) by re-prd-rgout-003.btmx-prd.synchronoss.net (5.8.340) (authenticated as jonturney@btinternet.com) id 5E3A16DE03D14E67; Sat, 29 Feb 2020 13:47:01 +0000 From: Jon Turney To: gdb-patches@sourceware.org Cc: Jon Turney Subject: [PATCH] gdb: Move defs.h before any system header in debuginfod-support.c Date: Sat, 29 Feb 2020 13:46:48 +0000 Message-Id: <20200229134648.2833-1-jon.turney@dronecode.org.uk> MIME-Version: 1.0 * defs.h includes config.h * config.h may define _GNU_SOURCE * if _GNU_SOURCE is defined, that must be before including any system header (see feature_test_macro(7)) This is necessary to ensure that a prototype for mkostemp() is brought into scope by when compiling filestuff.h, on platforms where _GNU_SOURCE isn't unconditionally defined for C++ (i.e. not Linux). In file included from ../../gdb/../gdbsupport/scoped_fd.h:24, from ../../gdb/debuginfod-support.c:22: ../../gdb/../gdbsupport/filestuff.h: In function ‘int gdb_mkostemp_cloexec(char*, int)’: ../../gdb/../gdbsupport/filestuff.h:59:10: error: ‘mkostemp’ was not declared in this scope; did you mean ‘mkstemp’? gdb/ChangeLog: 2020-02-29 Jon Turney * debuginfod-support.c: Include defs.h first. --- gdb/ChangeLog | 4 ++++ gdb/debuginfod-support.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/debuginfod-support.c b/gdb/debuginfod-support.c index e0f0fac076..f4a227b040 100644 --- a/gdb/debuginfod-support.c +++ b/gdb/debuginfod-support.c @@ -16,8 +16,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include #include "defs.h" +#include #include "cli/cli-style.h" #include "gdbsupport/scoped_fd.h" #include "debuginfod-support.h"