Re: [9fans] 8c, 8l, and empty files

2009-03-04 Thread Juan Céspedes
On Wed, Mar 4, 2009 at 12:43 AM, Anthony Sorace wrote: > i could see this going either way, but from my perspective the linker > did what you told it. The linker has NOT done what it is supposed to do. From the man page: > These commands load the named files into executable files > for the corr

Re: [9fans] 8c, 8l, and empty files

2009-03-04 Thread Charles Forsyth
viewing the source code, i suspect it's an oversight rather than essential design.

Re: [9fans] 8c, 8l, and empty files

2009-03-04 Thread Enrique Soriano
> "Garbage-in, Garbage-out" What does it happen when you try to link an object file that does not have main() defined? And when you try to link a malformed object file? In these cases, there is not any garbage-out for the garbage-in. There is an error, as expected. > two things: the linker doe

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread Federico G. Benavento
I consider that a feature, specially when starting something new I just touch the files I think I will need and put them in the mkfile it just works! On Tue, Mar 3, 2009 at 5:03 PM, Enrique Soriano wrote: > term% cd /tmp > term% ls nothing.c > ls: nothing.c: 'nothing.c' file does not exist > ter

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread Uriel
"Unix never says 'please'" Nor is it supposed to keep users from doing stupid things... thank God, or I could not use it. uriel On Wed, Mar 4, 2009 at 12:45 AM, andrey mirtchovski wrote: >> Or perhaps, since the user went to trouble of making sure the file >> didn't exist and then creating the

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread andrey mirtchovski
two things: the linker doesn't only produce binaries, it has options for producing other output in which a null object file may be applicable; furthermore, it takes more than a single file, so you can see how a #ifdef-ed C file compiles to nothing (even if it's bad practice) but then is linked with

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread andrey mirtchovski
> Or perhaps, since the user went to trouble of making sure the file > didn't exist and then creating the empty file, the compiler and linker > felt it would be rude if they didn't do something with it? you can call Plan 9 whatever you'd like, but don't call it "impolite" :)

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread Anthony Sorace
i could see this going either way, but from my perspective the linker did what you told it. it didn't see anything it couldn't recognize, and didn't find any symbols it wasn't able to resolve. it's a weird case, certainly, but it doesn't strike me as wrong. if i were inclined to submit a patch, it

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread J.R. Mauro
On Tue, Mar 3, 2009 at 6:37 PM, andrey mirtchovski wrote: >> Does it have any sense to create a 0 byte executable file? >> Success or failure? Can you execute it? > > "Garbage-in, Garbage-out" Or perhaps, since the user went to trouble of making sure the file didn't exist and then creating the em

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread andrey mirtchovski
> Does it have any sense to create a 0 byte executable file? > Success or failure? Can you execute it? "Garbage-in, Garbage-out"

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread Enrique Soriano
On Mar 3, 2009, at 11:54 PM, andrey mirtchovski wrote: if nobody replies to your email, would you report an error? or, if you prefer: if a linker has nothing to link (in the forest), should everybody hear about it? :) Commands are expected to be loud on errors and silent on success. Do

Re: [9fans] 8c, 8l, and empty files

2009-03-03 Thread andrey mirtchovski
if nobody replies to your email, would you report an error? or, if you prefer: if a linker has nothing to link (in the forest), should everybody hear about it? :)

[9fans] 8c, 8l, and empty files

2009-03-03 Thread Enrique Soriano
term% cd /tmp term% ls nothing.c ls: nothing.c: 'nothing.c' file does not exist term% touch nothing.c term% 8c -FVw nothing.c term% 8l -o nothing nothing.8 term% echo $status term% ls -l nothing --rwxrwxr-x M 8 glenda glenda 0 Mar 3 21:49 nothing term% ./nothing ./nothing: exec header invalid