From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7261 invoked by alias); 22 Feb 2006 18:36:24 -0000 Received: (qmail 7245 invoked by uid 22791); 22 Feb 2006 18:36:23 -0000 X-Spam-Check-By: sourceware.org Received: from gandalf.inter.net.il (HELO gandalf.inter.net.il) (192.114.186.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 22 Feb 2006 18:36:23 +0000 Received: from nitzan.inter.net.il (nitzan.inter.net.il [192.114.186.20]) by gandalf.inter.net.il (MOS 3.7.1-GA) with ESMTP id HYL29824; Wed, 22 Feb 2006 20:34:50 +0200 (IST) Received: from HOME-C4E4A596F7 (IGLD-83-130-205-93.inter.net.il [83.130.205.93]) by nitzan.inter.net.il (MOS 3.7.3-GA) with ESMTP id CTN03538 (AUTH halo1); Wed, 22 Feb 2006 20:34:49 +0200 (IST) Date: Wed, 22 Feb 2006 18:50:00 -0000 Message-Id: From: Eli Zaretskii To: Charles Wilson CC: gdb-patches@sourceware.org In-reply-to: <43FBF706.9030604@cwilson.fastmail.fm> (message from Charles Wilson on Wed, 22 Feb 2006 00:30:46 -0500) Subject: Re: RFA: ensure binary objects opened in binary mode Reply-to: Eli Zaretskii References: <43F6473F.8030508@cwilson.fastmail.fm> <20060217234141.GA1918@trixie.casa.cgf.cx> <200602181118.k1IBIwNC028708@elgar.sibelius.xs4all.nl> <43FBF706.9030604@cwilson.fastmail.fm> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00420.txt.bz2 > Date: Wed, 22 Feb 2006 00:30:46 -0500 > From: Charles Wilson > CC: gdb-patches@sourceware.org > > Okay, I've attached two patches that hopefully address all the issues > raised in this thread. Thanks. > (1) for every file that #includes both defs.h AND , remove the > inclusion. I'm not sure this is a good idea. What if tomorrow we remove fcntl.h from defs.h--do we go through all these files again and add it back? Why bother? fcntl.h should be idempotent, so including it several times does no real harm. I actually quite dislike source files that don't include standard headers because they are included in defs.h and its ilk. It makes me wonder how come foo.c uses something defined in bar.h, but there's no "#include " anywhere in sight. > (2) Further, for every file that contains the #ifndef...#define > O_BINARY...#endif stanza (all of which #include defs.h), that stanza is > removed (3 line change to each of 5 files) This is what I think we wanted. We don't want O_BINARY defined identically in several places. So I'd prefer if you committed the 1st and the 3rd patch. but not the second. However, before you actually do that, let's wait and hear what others think. > +/* In case this is not defined in fcntl.h */ > + > +#ifndef O_BINARY > +#define O_BINARY 0 > +#endif I'd change the comment to explain that O_BINARY has a meaning on non-Posix platforms, while on Posix platforms it should be a no-op. That is the _real_ reason we define O_BINARY.