www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1963] New: -H creates broken headers

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

           Summary: -H creates broken headers
           Product: D
           Version: 2.012
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: lindevel gmx.net


-H creates broken headers like the attached one. It contains for example
spurious "else" keywords.

/opt/dmd/include/phobos/std/stdio.d(111): found 'else' instead of statement
/opt/dmd/include/phobos/std/stdio.d(138): found 'else' instead of statement
/opt/dmd/include/phobos/std/stdio.d(295): found 'else' instead of statement
/opt/dmd/include/phobos/std/stdio.d(298): found 'else' instead of statement
/opt/dmd/include/phobos/std/stdio.d(340): found 'bool' when expecting ';'
following 'statement'
/opt/dmd/include/phobos/std/stdio.d(366): found 'else' instead of statement
/opt/dmd/include/phobos/std/stdio.d(374): found 'else' instead of statement


-- 
Mar 31 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963






Created an attachment (id=240)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=240&action=view)
Example of broken header

PS: This header was generated like this:
/var/tmp/portage/dev-lang/dmd-bin-2.012/work/dmd/bin/dmd -Istd/ -o- -c -H 
-Hfinclude/std/stdio.d std/stdio.d


-- 
Mar 31 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


chris dprogramming.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris dprogramming.com
           Keywords|                            |rejects-valid





Small example of -H producing broken output, DMD 1.028:

template Foo(bool bar)
{
        void test()
        {
                static if(bar)
                { // Note the empty block.
                }
                else
                {
                }
        }
}

// -H output:

// D import file generated from 'H.d'
template Foo(bool bar)
{
void test()
{
static if(bar)
else

}
}


-- 
Apr 11 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963






Found another problem with -H:

template Foo()
{
        void bar()
        {
        }
}

class Baz
{
        mixin Foo foo;

        alias foo.bar baz;
}

// -H output:

// D import file generated from 'H.d'
template Foo()
{
void bar()
{
}
}
class Baz
{
    mixin Foo!(); // Note: no mixin identifier foo as it should.
    alias foo.bar baz; // Now foo doesn't exist, error.
}


-- 
Apr 11 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


lindevel gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.012                       |2.014





Issue is still present in 2.0.14.


-- 
Jun 09 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


larsivar igesund.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.014                       |2.012





Versions should stay at the earliest known.


-- 
Jun 09 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.031 and 2.015


-- 
Jun 22 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963






Created an attachment (id=259)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=259&action=view)
algorithm.d

Persists in 2.0.15, though in slightly different form.

To make this easier to check, you should include the version number of dmd
which created the header file. Because of the recent Makefile changes, my fixes

to create the headers...


Compiling this sample:
---
import std.stdio;

void main(string[] args)
{
        writefln("Hello world!");
}
---

Creates this output:

/opt/dmd/include/phobos/std/stdio.d(368): found 'bool' when expecting ';'
following 'statement'
/opt/dmd/include/phobos/std/string.d(101): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/string.d(101): semicolon expected, not 'dchar'
/opt/dmd/include/phobos/std/string.d(102): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/string.d(102): semicolon expected, not 'dchar'
/opt/dmd/include/phobos/std/algorithm.d(86): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/algorithm.d(86): semicolon expected, not 'uint'
/opt/dmd/include/phobos/std/algorithm.d(736): found '!=' when expecting ')'
/opt/dmd/include/phobos/std/algorithm.d(736): found ')' when expecting ';'
following 'statement'
/opt/dmd/include/phobos/std/algorithm.d(748): found 'else' instead of statement
/opt/dmd/include/phobos/std/algorithm.d(755): Declaration expected, not 'else'
/opt/dmd/include/phobos/std/algorithm.d(760): unrecognized declaration
/opt/dmd/include/phobos/std/c/stdlib.d(63): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/c/stdlib.d(63): semicolon expected, not 'int'
/opt/dmd/include/phobos/std/c/stdlib.d(63): Error: identifier 'manifest' is not
defined
/opt/dmd/include/phobos/std/c/stdlib.d(63): Error: manifest is used as a type
/opt/dmd/include/phobos/std/c/stdlib.d(63): variable voids have no value
/opt/dmd/include/phobos/std/encoding.d(57): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/encoding.d(57): semicolon expected, not 'dchar'
/opt/dmd/include/phobos/std/traits.d(607): no identifier for declarator
manifest
/opt/dmd/include/phobos/std/traits.d(607): semicolon expected, not 'byte'


-- 
Jun 23 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


lindevel gmx.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




-- 
Jun 23 2008
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963







 anymore, which resulted in the system dmd being used to create the headers...
To make this clear: This does not mean that the attached header, or the header used to make dmd fail were generated by dmd 2.014. After fixing my patch, the headers are generated by 2.015 again, which creates that slightly different, but still incorrect, output. --
Jun 23 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1963


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.038 amd 2.022


-- 
Dec 25 2008