From patchwork Sun Dec 2 13:05:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stafford Horne X-Patchwork-Id: 30517 Received: (qmail 75494 invoked by alias); 2 Dec 2018 13:05:26 -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 75386 invoked by uid 89); 2 Dec 2018 13:05:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:mail-pf, HX-HELO:sk:mail-pf, Hx-spam-relays-external:sk:mail-pf, H*RU:sk:mail-pf X-HELO: mail-pf1-f180.google.com Received: from mail-pf1-f180.google.com (HELO mail-pf1-f180.google.com) (209.85.210.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 02 Dec 2018 13:05:23 +0000 Received: by mail-pf1-f180.google.com with SMTP id z9so5014420pfi.2 for ; Sun, 02 Dec 2018 05:05:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1O/HhSRI6kz2OliNTcgRq8VqZM8S+mJoO41b5vo3Y6Y=; b=XdIrOyz1OQu2q5BpucEGOcKZVE+j/nvEF76l7KcJ7KfuE9gFbLnWpShg0Me9wwT0BU 8JwmrNN9AGr1c1UUgpM6v0hfIBHtHHD580d3zfBNqLQdhU+h1wXZq8gXpYA3b9tTS4cX REwtXPDw2EJV7O6bU2esc06guj1I7ITnGRDxZaH5gB+PhRg3t423zPaJ05guv2BuMXm4 eKbKFGppc218IMJPFxh7UK49s7icVoFS5fqqEJIrgL1rFxVjpTrWDiu0mAB3FC7U8TB2 76QsKMIVeCnf+QvdSs0hUN/VtukwPzdtpfFq9Qt8SHeUeby2CBofYJqyGrhNO996vE2s fj4w== Return-Path: Received: from localhost (g206.124-44-15.ppp.wakwak.ne.jp. [124.44.15.206]) by smtp.gmail.com with ESMTPSA id 186sm16250503pga.36.2018.12.02.05.05.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 02 Dec 2018 05:05:21 -0800 (PST) From: Stafford Horne To: GDB patches Cc: Stafford Horne Subject: [PATCH 2/3] include/dis-asm.h: Fix warning: Include "string.h" for strchr Date: Sun, 2 Dec 2018 22:05:09 +0900 Message-Id: <20181202130510.10056-3-shorne@gmail.com> In-Reply-To: <20181202130510.10056-1-shorne@gmail.com> References: <20181202130510.10056-1-shorne@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes I got this warning when building the OpenRISC sim target. Warning: In file included from ../../../binutils-gdb/sim/or1k/../common/cgen-trace.c:26: ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h: In function ‘next_disassembler_option’: ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h:343:21: warning: implicit declaration of function ‘strchr’ [-Wimplicit-function-declaration] const char *opt = strchr (options, ','); ^~~~~~ ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h:343:21: warning: incompatible implicit declaration of built-in function ‘strchr’ ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h:343:21: note: include ‘’ or provide a declaration of ‘strchr’ ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h:40:1: +#include ../../../binutils-gdb/sim/or1k/../../include/dis-asm.h:343:21: const char *opt = strchr (options, ','); ^~~~~~ include/ChangeLog: dis-asm.h: Include "string.h" --- include/dis-asm.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dis-asm.h b/include/dis-asm.h index 84627950c0..823bba5b45 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -32,6 +32,10 @@ extern "C" { #endif #include +/* For strchr. */ +#ifdef HAVE_STRING_H +#include +#endif #include "bfd.h" typedef int (*fprintf_ftype) (void *, const char*, ...) ATTRIBUTE_FPTR_PRINTF_2;