www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Win7 64-bit

reply Dan McLeran <danmcleran yahoo.com> writes:
I am running the dmd2 compiler on my Win7 64 bit machine and everything
appears to work except the -cov switch. i cannot seem to generate a .lst file.
any ideas?

thanks

dan mcleran
Mar 01 2011
parent reply Dan McLeran <danmcleran yahoo.com> writes:
never mind, i got it. i had to pass the switches:

-D -unittest -cov

life is hard. it's even harder when you're dumb.
Mar 01 2011
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
On 01/03/2011 23:19, Dan McLeran wrote:
 never mind, i got it. i had to pass the switches:

 -D -unittest -cov

 life is hard. it's even harder when you're dumb.
Would you care to enlighten the rest of us on what code you were using that requires those extra switches? Stewart.
Mar 06 2011
parent reply Jonathan M Davis <jmdavisProg gmx.com> writes:
On Sunday 06 March 2011 17:48:12 Stewart Gordon wrote:
 On 01/03/2011 23:19, Dan McLeran wrote:
 never mind, i got it. i had to pass the switches:
 
 -D -unittest -cov
 
 life is hard. it's even harder when you're dumb.
Would you care to enlighten the rest of us on what code you were using that requires those extra switches?
Yeah. That's weird. If you want to run the unit tests, you use -unittest. If you want code coverage, you use -unittest and -cov. If you want documentation, you use -D, but it has no relation to -unittest and -cov, and it isn't necessarily a good idea to build your code with -D normally because of the effects that version(D_Ddoc) could have on your code, and there are a number places in druntime and Phobos which won't result in valid code if you build with -D (until it's fixed in the next release so that druntime and Phobos' documentation is versioned with version(StdDoc) instead). So, _needing_ all three of those flags seems just plain wrong. If you're using -cov, you probably want -unittest, but -D has no relation to the others and shouldn't be necessary for _anything_ other than generating documentation. - Jonathan M Davis
Mar 06 2011
parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
On 07/03/2011 02:10, Jonathan M Davis wrote:
<snip>
 If you're using -cov, you probably want -unittest,
<snip> I disagree: - Most of the time I use -cov, it's to check the normal flow of program logic, rather than the unittests. It's true that it *can* be used to check that the unittests cover all cases, but that's far from its only use. - Even if checking unittests were its only *practical* use, it would be arbitrary to program in a restriction explicitly. - If there are circumstances in which code coverage analysis shouldn't be allowed, the compiler should complain, not silently ignore the switch. That it ignores -cov in the absence of these other switches is a bona fide bug. You're in a better position to put it into Bugzilla than I am. Moreover, does DMD have a Win64 (either runs on or compiles for) version? Or is it just the normal Win32 version, running on your 64-bit system? It would be useful if we could find out the circumstances in which this bug bites. Stewart.
Mar 07 2011
parent Jonathan M Davis <jmdavisProg gmx.com> writes:
On Monday, March 07, 2011 06:23:09 Stewart Gordon wrote:
 On 07/03/2011 02:10, Jonathan M Davis wrote:
 <snip>
 
 If you're using -cov, you probably want -unittest,
<snip> I disagree: - Most of the time I use -cov, it's to check the normal flow of program logic, rather than the unittests. It's true that it *can* be used to check that the unittests cover all cases, but that's far from its only use. - Even if checking unittests were its only *practical* use, it would be arbitrary to program in a restriction explicitly.
I believe that the _common_ use case for -cov is to check the coverage of your unit tests, in which case you'd also need to use -unittest (that's what is _normally_ meant when talking about code coverage). However, there's nothing stopping you from using it when running your program normally.
 Moreover, does DMD have a Win64 (either runs on or compiles for) version? 
 Or is it just the normal Win32 version, running on your 64-bit system?  It
 would be useful if we could find out the circumstances in which this bug
 bites.
As far dmd itself goes, only a 32-bit binary exists, and Walter has no plans to create 64-bit version. In terms of compiling with dmd, Linux got 64-bit compilation (when you use -m64) with the latest release, but there are a number of things which will need to be sorted out before dmd will be able to compile 64-bit programs on Windows (including having a 64-bit linker). - Jonathan M Davis
Mar 07 2011