Message ID | CADip9ga4rPr6NiNzPBcEZCEwacMmGaNkvU-ZnmDw2L21qmXv2Q@mail.gmail.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 105271 invoked by alias); 11 Jan 2019 09:47:56 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 105258 invoked by uid 89); 11 Jan 2019 09:47:56 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, FROM_EXCESS_BASE64, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Received:Fri, H*c:alternative, H*F:D*ru X-HELO: mail-it1-f171.google.com Received: from mail-it1-f171.google.com (HELO mail-it1-f171.google.com) (209.85.166.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 11 Jan 2019 09:47:53 +0000 Received: by mail-it1-f171.google.com with SMTP id b5so2182682iti.2 for <gdb-patches@sourceware.org>; Fri, 11 Jan 2019 01:47:53 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?B?0J/QsNCy0LXQuyDQmtGA0Y7QutC+0LI=?= <kryukov@frtk.ru> Date: Fri, 11 Jan 2019 12:47:42 +0300 Message-ID: <CADip9ga4rPr6NiNzPBcEZCEwacMmGaNkvU-ZnmDw2L21qmXv2Q@mail.gmail.com> Subject: [PATCH] Include <string.h> to dis-asm.h to get strchr declaration To: gdb-patches@sourceware.org Content-Type: text/plain; charset="UTF-8" |
Commit Message
Павел Крюков
Jan. 11, 2019, 9:47 a.m. UTC
Include <string.h> to dis-asm.h to get strchr declaration include/Changelog: 2019-01-11 Pavel I. Kryukov <kryukov@frtk.ru> * dis-asm.h: include <string.h> ATTRIBUTE_FPTR_PRINTF_2;
Comments
On 2019-01-11 04:47, Павел Крюков wrote: > Include <string.h> to dis-asm.h to get strchr declaration > > include/Changelog: > 2019-01-11 Pavel I. Kryukov <kryukov@frtk.ru> > > * dis-asm.h: include <string.h> > > diff --git a/include/dis-asm.h b/include/dis-asm.h > index 77b9e61..02c7214 100644 > --- a/include/dis-asm.h > +++ b/include/dis-asm.h > @@ -32,6 +32,7 @@ extern "C" { > #endif > > #include <stdio.h> > +#include <string.h> > #include "bfd.h" > > typedef int (*fprintf_ftype) (void *, const char*, ...) > ATTRIBUTE_FPTR_PRINTF_2; [Adding binutils@ in CC.] I took the liberty of pushing this patch which touches code in include/, since it seemed obvious enough to me. Simon
Hi Simon, >> Include <string.h> to dis-asm.h to get strchr declaration >> #include <stdio.h> >> +#include <string.h> >> #include "bfd.h" > I took the liberty of pushing this patch which touches code in include/, since it seemed obvious enough to me. Do we need to worry about systems that have <strings.h> rather than <string.h> ? There are various places in the binutils sources (eg binutils/sysdep.h) which check for configure macros for these headers, which makes me wonder... Cheers Nick
On 2019-01-15 09:01, Nick Clifton wrote: > Hi Simon, > >>> Include <string.h> to dis-asm.h to get strchr declaration > >>> #include <stdio.h> >>> +#include <string.h> >>> #include "bfd.h" > >> I took the liberty of pushing this patch which touches code in >> include/, since it seemed obvious enough to me. > > Do we need to worry about systems that have <strings.h> rather than > <string.h> ? > > There are various places in the binutils sources (eg binutils/sysdep.h) > which > check for configure macros for these headers, which makes me wonder... From what I understand, these systems (BSDs, mostly) have strings.h in addition to string.h, where strings.h provide additional, non-standard functions. But strchr would still be found in string.h. Simon
On 1/15/19 6:14 AM, Simon Marchi wrote: > On 2019-01-15 09:01, Nick Clifton wrote: >> Hi Simon, >> >>>> Include <string.h> to dis-asm.h to get strchr declaration >> >>>> #include <stdio.h> >>>> +#include <string.h> >>>> #include "bfd.h" >> >>> I took the liberty of pushing this patch which touches code in >>> include/, since it seemed obvious enough to me. >> >> Do we need to worry about systems that have <strings.h> rather than >> <string.h> ? >> >> There are various places in the binutils sources (eg binutils/sysdep.h) >> which >> check for configure macros for these headers, which makes me wonder... > > From what I understand, these systems (BSDs, mostly) have strings.h in > addition to string.h, where strings.h provide additional, non-standard > functions. But strchr would still be found in string.h. Yes, that is true on both FreeBSD and OS X at least (both of which have <strings.h>). On those, <strings.h> defines prototypes for things like bzero() and bcmp().
diff --git a/include/dis-asm.h b/include/dis-asm.h index 77b9e61..02c7214 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -32,6 +32,7 @@ extern "C" { #endif #include <stdio.h> +#include <string.h> #include "bfd.h" typedef int (*fprintf_ftype) (void *, const char*, ...)