public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc writing to /dev/null actually writes to /dev/null.exe
@ 2013-09-09 17:09 Adam Kellas
  2013-09-09 17:38 ` Larry Hall (Cygwin)
  2013-09-09 19:12 ` Ryan Johnson
  0 siblings, 2 replies; 3+ messages in thread
From: Adam Kellas @ 2013-09-09 17:09 UTC (permalink / raw)
  To: cygwin

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.

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc writing to /dev/null actually writes to /dev/null.exe
  2013-09-09 17:09 gcc writing to /dev/null actually writes to /dev/null.exe Adam Kellas
@ 2013-09-09 17:38 ` Larry Hall (Cygwin)
  2013-09-09 19:12 ` Ryan Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Larry Hall (Cygwin) @ 2013-09-09 17:38 UTC (permalink / raw)
  To: cygwin

On 9/9/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 can't imagine that this corner case is worth adding overhead to the
transparent exe handling code.  It also would open the door to arguments
to support other special cases.  That said, the final say goes to the
persons who generate a patch and those who review it.

-- 
Larry

_____________________________________________________________________

A: Yes.
 > Q: Are you sure?
 >> A: Because it reverses the logical flow of conversation.
 >>> Q: Why is top posting annoying in email?

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc writing to /dev/null actually writes to /dev/null.exe
  2013-09-09 17:09 gcc writing to /dev/null actually writes to /dev/null.exe Adam Kellas
  2013-09-09 17:38 ` Larry Hall (Cygwin)
@ 2013-09-09 19:12 ` Ryan Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Ryan Johnson @ 2013-09-09 19:12 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-09-09 17:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-09 17:09 gcc writing to /dev/null actually writes to /dev/null.exe Adam Kellas
2013-09-09 17:38 ` Larry Hall (Cygwin)
2013-09-09 19:12 ` Ryan Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).