Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Conversation

@ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Feb 12, 2017

Two more commits to follow, one refactoring of escape.c, and another that implements return scope.

@ibuclaw ibuclaw force-pushed the dip25 branch 4 times, most recently from e57a3fa to 01773b1 Compare February 12, 2017 17:55
@jpf91
Copy link
Contributor

jpf91 commented Feb 17, 2017

@ibuclaw OT, but I just tried to build GDC with an older GCC (4.9) and glibc (2.13) and got this error:

In file included from /home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/visitor.h:14:0,
                 from /home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/dsymbol.h:24,
                 from /home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c:16:
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c: In static member function 'static Type* toArgTypes(Type*)::ToArgTypes::argtypemerge(Type*, Type*, unsigned int)':
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c:248:26: error: 'UINT64_MAX' was not declared in this scope
             assert(sz2 < UINT64_MAX - UINT32_MAX);
                          ^
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c:248:39: error: 'UINT32_MAX' was not declared in this scope
             assert(sz2 < UINT64_MAX - UINT32_MAX);
                                       ^
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c: In member function 'virtual void toArgTypes(Type*)::ToArgTypes::visit(TypeStruct*)':
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c:404:69: error: 'UINT64_MAX' was not declared in this scope
                         assert(fieldsz != SIZE_INVALID && fieldsz < UINT64_MAX - UINT32_MAX);
                                                                     ^
/home/build/tmp/patch/gcc-7-20161127/gcc/d/dfrontend/argtypes.c:404:82: error: 'UINT32_MAX' was not declared in this scope
                         assert(fieldsz != SIZE_INVALID && fieldsz < UINT64_MAX - UINT32_MAX);
                                                                                  ^
/home/build/tmp/patch/gcc-7-20161127/gcc/d/Make-lang.in:115: recipe for target 'd/argtypes.o' failed

Looks like one of these files is missing a stdint.h include which seems to be hidden by changes in newer glibc releases.

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 18, 2017

Yeah, can put it in argtypes.c

@ibuclaw
Copy link
Member Author

ibuclaw commented Feb 18, 2017

Actually, even better, it's part of some ISO compat code:

/* The ISO C99 standard specifies that in C++ implementations these
   macros should only be defined if explicitly requested.  */
#if !defined __cplusplus || defined __STDC_LIMIT_MACROS

I guess this is now no longer the case.

Copy link
Contributor

@jpf91 jpf91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like phobos needs some updates as well?

return op == TOKassign ? reorderSettingAAElem(sc) : this;
Expression *result = op == TOKassign ? reorderSettingAAElem(sc) : this;
checkAssignEscape(sc, result, false);
return result;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, there's something funny going on here that triggers the error. The build error infact shouldn't happen because attributes should be inferred.

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 6, 2017

Ah wait, yes, you are right.

Minimal test:

module std.stdio;

struct File
{
    this(string name) @safe
    {
        .fopen(name);
    }

}

void fopen(R1)(R1 name)
{   
    import std.internal.cstring;
    name.tempCString;
}

Digging out the changelog for tempCString and I found this dlang/phobos#4746

@ibuclaw
Copy link
Member Author

ibuclaw commented Mar 7, 2017

And lastly, a bunch of fail tests got merged into one file (fail_scope.d), forgot to remove these individual test files.

@ibuclaw ibuclaw merged commit 4f8a5e7 into D-Programming-GDC:master Mar 7, 2017
@ibuclaw ibuclaw deleted the dip25 branch March 7, 2017 10:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants