From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23140 invoked by alias); 13 Sep 2013 23:08:20 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23128 invoked by uid 89); 13 Sep 2013 23:08:19 -0000 Received: from mail-ie0-f169.google.com (HELO mail-ie0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 13 Sep 2013 23:08:19 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,NO_RELAYS autolearn=ham version=3.3.2 X-HELO: mail-ie0-f169.google.com Received: by mail-ie0-f169.google.com with SMTP id tp5so4071150ieb.0 for ; Fri, 13 Sep 2013 16:08:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=mOC6knwfPShEhdVWbPvHkveUl/MI9AZKCZ06pUJOb4c=; b=WhNRwq7kQWDfMx2SppMwzN2kGSjOJju5JBzim4R/xhxDjd4rZK3wfz2OlAKdVx69fC FYoP7IV+pfdJR5+Cxb0XZW5msAd+KHtFNBQSENOIDoemkjwUQWiNjUcV8lu0uCM7Wuoy Ob6cW0OcSHjq60oKFDUeS3ayTu0BwEzAeOt1otgd4OdrgeTqUCMIBFPXtKwCVKdif2Hu OuRgMbfiYOdZT45JHjLw6JhH+/7wNeHV7VO8MpS1CT/5kge41p6bQbXg5dX3k8v73MSo em5wsAKfANeGmG/jDCNw+jRtJ+StqZvsg7ALrcGho5OM/MnVO4fb5z6mPI/q2D0IFxTk Uo7g== X-Gm-Message-State: ALoCoQkpKic9eoTznDtLR9vrqbh4IqHHqWq6/Ia4lyyS+gmffTsCK2YLoh00kVd5Jzd/W19G41EEgrpOZpHsCdT0x5yH0sKTrmRP7Te69QPpQjAsAeTqjBh1/9rvj0gmjj018C9S0aNHBemHvjienFFAvpLhxHLnbAtQOoMGrl1UCqNADh/XyqqNejWtJUtoHgGeNro9IuTH4yKVEKbiMUiTiOfWka5HTQ== MIME-Version: 1.0 X-Received: by 10.50.20.3 with SMTP id j3mr2305800ige.11.1379113696935; Fri, 13 Sep 2013 16:08:16 -0700 (PDT) Received: by 10.64.31.100 with HTTP; Fri, 13 Sep 2013 16:08:16 -0700 (PDT) In-Reply-To: <5233934f.8360440a.1d3e.ffffa937SMTPIN_ADDED_BROKEN@mx.google.com> References: <002201ce9414$7e0d7130$7a285390$@muller@ics-cnrs.unistra.fr> <83bo57rm59.fsf@gnu.org> <41630.7793967009$1376385245@news.gmane.org> <874natr48x.fsf@fleche.redhat.com> <520b6c37.e9e6440a.7cfb.45fcSMTPIN_ADDED_BROKEN@mx.google.com> <520B719B.3020904@redhat.com> <5233934f.8360440a.1d3e.ffffa937SMTPIN_ADDED_BROKEN@mx.google.com> Date: Fri, 13 Sep 2013 23:08:00 -0000 Message-ID: Subject: Re: [RFA-v3] Avoid invalid parameter warnings in C runtime function for mingw built GDB From: Doug Evans To: Pierre Muller Cc: gdb-patches , Tom Tromey , Eli Zaretskii , Pedro Alves Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00414.txt.bz2 Hi. Patch is ok with me. On Fri, Sep 13, 2013 at 3:35 PM, Pierre Muller wrote: > Ping? > > Nobody reacted to this third version... > > Pierre Muller > > >> -----Message d'origine----- >> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches- >> owner@sourceware.org] De la part de Pierre Muller >> Envoy=E9 : mercredi 14 ao=FBt 2013 14:13 >> =C0 : 'Pedro Alves' >> Cc : 'Tom Tromey'; 'Eli Zaretskii'; gdb-patches@sourceware.org >> Objet : [RFA-v3] Avoid invalid parameter warnings in C runtime function > for >> mingw built GDB >> >> >> >> > -----Message d'origine----- >> > De : gdb-patches-owner@sourceware.org [mailto:gdb-patches- >> > owner@sourceware.org] De la part de Pedro Alves >> > Envoy=E9 : mercredi 14 ao=FBt 2013 14:02 >> > =C0 : Pierre Muller >> > Cc : 'Tom Tromey'; 'Eli Zaretskii'; gdb-patches@sourceware.org >> > Objet : Re: [RFA-v2] Avoid invalid parameter warnings in C runtime >> function >> > for mingw built GDB >> > >> > On 08/14/2013 12:38 PM, Pierre Muller wrote: >> > >> > > Is this OK to commit? >> > > Maybe some comments on the ChangeLog entry? >> > >> > > * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e" >> > > mode if operating system doesn't know O_CLOEXEC, this allows to >> > > avoid getting a output debug string warning for mingw hosted >> > > GDB executables. >> > >> > This comment should really be in the sources instead. That here you'd >> > have: >> > >> > * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e" >> > mode if operating system doesn't know O_CLOEXEC. >> >> I knew that the ChangeLog entry was not what is usually expected... >> But your version seems perfect! >> >> > and in the source, where you have: >> > >> > > + /* If O_CLOEXEC is zero, the operating system doesn't >> > > + know about close on exec mode "e", so don't even try to use it. >> */ >> > > + static int fopen_e_ever_failed =3D O_CLOEXEC =3D=3D 0; >> > >> > I suggest: >> > >> > /* Probe for "e" support once. But, if we can tell the operating >> > system doesn't know about close on exec mode "e" without probing, >> > skip it. E.g., the Windows runtime issues an "Invalid parameter >> > passed to C runtime function" OutputDebugString warning for >> > unknown modes. Assume that if O_CLOEXEC is zero, then "e" isn't >> > supported. */ >> > static int fopen_e_ever_failed; >> Your comment is much better indeed, but let's still keep the >> static int fopen_e_ever_failed =3D O_CLOEXEC =3D=3D 0; >> line, which is the only real change to the code... >> >> > -- >> > Pedro Alves >> >> Thanks Pedro! >> >> Is this third version OK? >> >> >> 2013-08-14 Pierre Muller >> Tom Tromey >> Pedro Alves >> >> * common/filestuff.c (gdb_fopen_cloexec): Do not try to use "e" >> mode if operating system doesn't know O_CLOEXEC. >> >> >> Index: common/filestuff.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> RCS file: /cvs/src/src/gdb/common/filestuff.c,v >> retrieving revision 1.7 >> diff -u -p -r1.7 filestuff.c >> --- common/filestuff.c 26 Jun 2013 08:01:55 -0000 1.7 >> +++ common/filestuff.c 14 Aug 2013 12:07:02 -0000 >> @@ -311,7 +311,13 @@ FILE * >> gdb_fopen_cloexec (const char *filename, const char *opentype) >> { >> FILE *result =3D NULL; >> - static int fopen_e_ever_failed; >> + /* Probe for "e" support once. But, if we can tell the operating >> + system doesn't know about close on exec mode "e" without probing, >> + skip it. E.g., the Windows runtime issues an "Invalid parameter >> + passed to C runtime function" OutputDebugString warning for >> + unknown modes. Assume that if O_CLOEXEC is zero, then "e" isn't >> + supported. */ >> + static int fopen_e_ever_failed =3D O_CLOEXEC =3D=3D 0; >> >> if (!fopen_e_ever_failed) >> {