delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/09/09/13:38:31

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
q=dns; s=default; b=PDeirJOE1SG2YXstmqX52kijClf4CvUHTrn830dwvzs
rH8b0OkwH2Y+b0lKAWaxukPPtkRWI7eE7rtRoAUZCW2NPW11ysZ/G9IwPeusGbWV
be6rzQ8T/p6m5MDkO/s8IzmBXbt4GZt3dNzB4Ph5zCxSGuU8qD6GyNkNy918PUa8
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:mime-version:to:subject
:references:in-reply-to:content-type:content-transfer-encoding;
s=default; bh=/XW7NjysvzPoyWZtyUlnhvC1sl4=; b=kGJ7Z5DPYB7T52/oO
iTGwByPpJWVMprrVpJWaBMtcYzTf1SOMVYS7xaSlxgkvHoyvRHCOFdV9D2SYLsd5
ieIKWhm+XRn8R3KzpyZTBl8pcSUHzCKSBHuJRahlDZa1+sZsUlDWVm+zetYrLNFC
WNHfezjGWXgru0hx0IczcD7ajk=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-3.5 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: bureau85.ns.utoronto.ca
Message-ID: <522E0700.20601@cs.utoronto.ca>
Date: Mon, 09 Sep 2013 13:36:00 -0400
From: Ryan Johnson <ryan DOT johnson AT cs DOT utoronto DOT ca>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gcc writing to /dev/null actually writes to /dev/null.exe
References: <CAJty3Zx2dRRsp31kwN6OGM-mJkGO6YsVVLHg9Y2JDsjH+0op7Q AT mail DOT gmail DOT com>
In-Reply-To: <CAJty3Zx2dRRsp31kwN6OGM-mJkGO6YsVVLHg9Y2JDsjH+0op7Q@mail.gmail.com>
X-IsSubscribed: yes

On 09/09/2013 12:24 PM, Adam Kellas wrote:
> Is this a bug which is fixable in Cygwin or just something to be lived with?
>
> % gcc -o /dev/null devnull.c
>
> % ls -ld /dev/null*
> crw-rw-rw-  1 dboyce Domain Users  1, 3 Sep  9 09:14 /dev/null
> -rwxrwxr-x+ 1 dboyce Domain Users 53827 Sep  9 09:14 /dev/null.exe
>
> % file /dev/null.exe
> /dev/null.exe: PE32 executable (console) Intel 80386, for MS Windows
>
> I'm aware of the .exe back story but this should be a special case, I think.
I don't think this is actually cygwin's fault; gcc is just helpfully 
(and silently) adding .exe to the requested filename (or maybe ld does 
that?). Cygwin file handling wouldn't come into the picture until you 
tried to invoke the resulting binary without the .exe extension...

It would probably cause all kinds of trouble to remove the automatic 
extension-adding feature entirely, but maybe a case could be made for 
not adding .exe to a file name that already exists in the filesystem?

Meanwhile, I've always used `gcc -o- devnull.c >/dev/null' for stuff 
like that...

Ryan


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

- Raw text -


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