From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28155 invoked by alias); 14 Aug 2013 12:01:38 -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 28140 invoked by uid 89); 14 Aug 2013 12:01:37 -0000 X-Spam-SWARE-Status: No, score=-8.7 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 14 Aug 2013 12:01:37 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7EC1X3p014549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 14 Aug 2013 08:01:33 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r7EC1Vha004219; Wed, 14 Aug 2013 08:01:32 -0400 Message-ID: <520B719B.3020904@redhat.com> Date: Wed, 14 Aug 2013 12:01:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Pierre Muller CC: "'Tom Tromey'" , "'Eli Zaretskii'" , gdb-patches@sourceware.org Subject: Re: [RFA-v2] Avoid invalid parameter warnings in C runtime function for mingw built GDB 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> In-Reply-To: <520b6c37.e9e6440a.7cfb.45fcSMTPIN_ADDED_BROKEN@mx.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-08/txt/msg00378.txt.bz2 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. 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 = O_CLOEXEC == 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; -- Pedro Alves