digitalmars.D.bugs - Compile an empty source file
- Russell Wilkins (5/5) Mar 24 2005 v0.119 windows
- Stewart Gordon (14/20) Apr 05 2005 Not sure about this. Do you mean the compiler or the linker? I can see...
v0.119 windows I quite by accident found you can compile a completely empty source file and get both an obj and an exe (which does nothing but runs without error). I think the compiler should error if no code has been generated. Russell
Mar 24 2005
Russell Wilkins wrote:v0.119 windows I quite by accident found you can compile a completely empty source file and get both an obj and an exe (which does nothing but runs without error).Congratulations, you've written the shortest ever D quine!I think the compiler should error if no code has been generated.Not sure about this. Do you mean the compiler or the linker? I can see a few legit reasons for a module having no code generated: - it's a module entirely of import statements, function prototypes, struct definitions, type aliases, symbolic constants, whatever else.... - it's a module that's only needed for certain platforms/editions/whatever, and so all the code may be versioned out (if that follows). OTOH, the linker ought to error, since there is no main function. Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Apr 05 2005