delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/01/12/13:22:21

X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: Define _POSIX_SOURCE in cygwin's features.h?
Date: Thu, 12 Jan 2006 18:22:11 -0000
MIME-Version: 1.0
In-Reply-To: <20060112181339.GC30108@trixie.casa.cgf.cx>
Message-ID: <SERRANOHaZVrDs9aAOP000000c7@SERRANO.CAM.ARTIMI.COM>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Christopher Faylor wrote:
> On Thu, Jan 12, 2006 at 07:08:32PM +0100, Samuel Thibault wrote:
>> But a portable program should _not_ assume that #defining _GNU_SOURCE
>> implies that _POSIX_SOURCE. If a program not only needs posix stuff but
>> also some GNU extras, it should #define _GNU_SOURCE _and_ _POSIX_SOURCE
>> itself.
> 
> I don't care about portable programs.  I'm interested in hearing if this
> will fix problems with programs which build without problem on linux.
> 
> cgf

  But it seems that it only builds "without problem" on Linux by chance, not
by design.

  I don't see why we should try and fix this in cygwin.

  Consider how many times people come here and say "My app works fine on
Linux, how come it just dies with a SEGV on cygwin" and someone points out the
trivially obvious buffer overrun and we have to explain how it only ever
worked on Linux by luck because of differences in the environment and the way
the stack is set up.

  Now, we could put masses of code into cygwin to try and reproduce whatever
feature it is of the Linux memory layout that allows these programs to get
away with overrunning their buffers and not crash, but I think that would be a
deeply silly and overly-complicated attempt to 'help' users with potentially
lots of side-effects that would cause problems for everyone, not just writers
of buggy programs, and I think that this is an (admittedly less extreme)
example of the same thing.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019