www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2643] New: -o- switch bearks semantic analysis

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643

           Summary: -o- switch bearks semantic analysis
           Product: D
           Version: 2.023
          Platform: PC
               URL: http://digitalmars.com/d/2.0/dmd-windows.html#switches
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: maxmo pochta.ru


---
module Test;

interface NetworkListener
{
    void onConnect();
}

class SoundManager : private NetworkListener
{
    private final void onConnect()
    {
    }
}
---
compiling this code with -c -o- switches yields no error messages, while
compilation with -c switch yields error.

dmd -c tmp.d -o- -I.. -w
dmd -c tmp.d -I.. -w
tmp.d(16): class Test.SoundManager interface function NetworkListener.onConnect isn't implemented --
Feb 03 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643







that's not a bug if you look at it a different way; -o- is to allow generating
ddoc output without having to run everything. 

OTOH if you see it as run a test build but don't generate object files...


-- 
Feb 03 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643






 that's not a bug if you look at it a different way; -o- is to allow generating
 ddoc output without having to run everything.
not everything, just object file generation
 OTOH if you see it as run a test build but don't generate object files...
well then this feature should be better documented, because *some* semantic analysis is *done* with -o- switch. I suspect that this surprise only pops up when compiler tries to build class's vtbl at codegen step, which means that semantic analysis is not fully done at right time. I intensively use gcc -fsyntax-only and never run into trouble with it, in spite of the switch name, it seems like it does full semantic analysis. --
Feb 05 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643






At some point I home that DMD will actual do more semantic stuff under -o- as
then I can get DDoc output for generated code. However even then DMD should
only do what is needed to generate the requested output.


-- 
Feb 05 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643






DMD actually does quite a bit of error handling during code generation. I've
been hit by this several times in LDC, where it means that quite a lot of the
time, you can't be sure the AST you're generating code for is valid.

I would love to see this fixed as well, but I can also understand that some
errors are a lot simpler to detect at the codegen stage, so it worth the
performance tradeoff ?

I'm not sure.


-- 
Feb 05 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert octarineparrot.com



*** Issue 5947 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 10 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2643


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
            Summary|-o- switch breaks semantic  |Front-end should check for
                   |analysis                    |unimplemented interface
                   |                            |functions



This is not just an issue with -o-. Because the error is only generated in the
glue layer, it isn't prevented from being sent to CTFE.

This means that in some circumstances, in CTFE, you can successfully call a
function which the compiler says does not exist!!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 22 2013