Skip to content

Errors compiling using Clang #19

Description

@jefvel

I am trying to compile bullet using webidl with Clang, but I'm getting these errors:

/Users/jefvel/project/libs/bullet/src/bullet.cpp:35:21: error: pasting formed 'u"delete() is not allowed on const value."', an invalid preprocessing token
        if( !r->finalize ) hl_error("delete() is not allowed on const value.");
                           ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:586:55: note: expanded from macro 'hl_error'
#define hl_error(msg, ...) hl_throw(hl_alloc_strbytes(USTR(msg), ## __VA_ARGS__))
                                                      ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:21: note: expanded from macro 'USTR'
#       define USTR(str)        u##str
                                 ^
/Users/jefvel/project/libs/bullet/src/bullet.cpp:35:21: error: use of undeclared identifier 'u'
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:586:55: note: expanded from macro 'hl_error'
#define hl_error(msg, ...) hl_throw(hl_alloc_strbytes(USTR(msg), ## __VA_ARGS__))
                                                      ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:20: note: expanded from macro 'USTR'
#       define USTR(str)        u##str
                                ^
/Users/jefvel/project/libs/bullet/../../hashlink/src/hl.h:234:20: note: expanded from macro 'u'
/Users/jefvel/project/libs/bullet/src/bullet.cpp:43:16: error: assigning to 'void *' from incompatible type 'void (*)(pref<btVector3> *)'
        r->finalize = finalize;
                      ^~~~~~~~
/Users/jefvel/project/libs/bullet/src/bullet.cpp:557:9: note: in instantiation of function template specialization '_alloc_ref<btVector3>' requested here
        return alloc_ref((new btVector3()),btVector3);
               ^
/Users/jefvel/project/libs/bullet/src/bullet.cpp:30:24: note: expanded from macro 'alloc_ref'
#define alloc_ref(r,t) _alloc_ref(r,finalize_##t)

...

(It continues with a lot more error: assigning to 'void *' from incompatible type ' X errors.)

I managed to circumvent this and successfully compile by using gcc and setting the flag -fpermissive, but I'm wondering if there could be some way to make it work in Clang directly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions