www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5535] New: Bulding with -D shouldn't an executable

reply d-bugmail puremagic.com writes:

           Summary: Bulding with -D shouldn't an executable
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com

--- Comment #0 from Jonathan M Davis <jmdavisProg gmx.com> 2011-02-06 17:40:15
PST ---
There's nothing on the page for the compiler (or in the --help for the
compiler, though it would probably be too verbose to put it that) which
indicates that building with -D or -version=D_Ddoc may not generate usable
code. It's perfectly legal to have a version(D_Ddoc) block which results in
code which is stubbed out, and it's _likely_ that that's going to be done in
cases where functions are system-specific, and you want to be able to build the
documentation on multiple platforms and/or build documentation for functions
which are only on a platform other than the one that you're building the
documentation on. Some of Phobos is in that sitatuation, and more of it will be
as it's fixed to be able to build documentation on all platforms instead of
just Windows. It can _also_ be useful to use version(D_Ddoc) blocks to generate
simplified function signatures in some cases, which would _also_ result in
unusable code if you build with -D.

It seems to me that we need to do one of two things if we don't want this to be
causing problems:

1. Alter dmd such that building with -D (and perhaps even when building with
-version=D_Ddoc if that's used explicitly), it does _not_ generate an
excecutable (or maybe any code at all) but just documentation. dmd _already_
doesn't build a normal executable when building with -unittest and -cov, so
that wouldn't be completely new (though -unittest and -cov generate altered
executables rather than none).

2. Make it clear in the dmd documentation that building with -D is _not_
generally expected to result in valid code. It will in many cases but not in
all. So, programmers should _not_ rely on it.

Personally, I'd prefer #1, but I'm not sure how Walter would feel about that.
If #1 is not reasonable, then #2 should be done.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2011
parent d-bugmail puremagic.com writes:

Jonathan M Davis <jmdavisProg gmx.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX

--- Comment #1 from Jonathan M Davis <jmdavisProg gmx.com> 2011-11-20 03:28:51
PST ---
I really don't think that documentation should be generated as part of a build
which generates an executable, but given that we decided that we weren't going
to assume that for Phobos and added StdDdoc to mitigate the problem, this
enhancement request stands no chance of ever being implemented, so I'm closing

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 20 2011