Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not build for windows & clang #26

Open
calvin2021y opened this issue Jun 10, 2023 · 2 comments
Open

can not build for windows & clang #26

calvin2021y opened this issue Jun 10, 2023 · 2 comments

Comments

@calvin2021y
Copy link

src/ebtree.h:492:10: error: invalid operand for instruction
        __asm__("bsrq %1,%0" : "+r" (r) : "rm" (x));
                ^
<inline asm>:1:17: note: instantiated into assembly here
        bsrq -16(%rbp),%eax
                       ^~~~
32 warnings generated.
26 warnings generated.
32 warnings and 1 error generated.
make: *** [Makefile:34: obj/static-eb64tree.o] Error 1
make: *** Waiting for unfinished jobs....
src/ebtree.h:492:10: error: invalid operand for instruction
        __asm__("bsrq %1,%0" : "+r" (r) : "rm" (x));
                ^
<inline asm>:1:17: note: instantiated into assembly here
        bsrq -16(%rbp),%eax
                       ^~~~
33 warnings and 1 error generated.
@calvin2021y
Copy link
Author

windows warning:

ebtree/src/ebtree.h:467:26: error: cannot assign to variable 'x' with const-qualified type 'const int'
        if (x & 0xf0f0f0f0) { x &= 0xf0f0f0f0; r += 0x04;}
                              ~ ^
ebtree/src/ebtree.h:457:35: note: variable 'x' declared const here
static inline int flsnz(const int x)
                        ~~~~~~~~~~^
/opt/d/C/ebtree/src/ebtree.h:468:26: error: cannot assign to variable 'x' with const-qualified type 'const int'
        if (x & 0xcccccccc) { x &= 0xcccccccc; r += 0x02;}
                              ~ ^
ebtree/src/ebtree.h:457:35: note: variable 'x' declared const here
static inline int flsnz(const int x)
                        ~~~~~~~~~~^
ebtree/src/ebtree.h:469:26: error: cannot assign to variable 'x' with const-qualified type 'const int'
        if (x & 0xaaaaaaaa) { x &= 0xaaaaaaaa; r += 0x01;}

@calvin2021y
Copy link
Author

windows clang:

ebtree/src/eb128tree.c:1126:12: warning: cast to smaller integer type 'long' from 'struct eb_root *' [-Wpointer-to-int-cast]
                                return container_of(eb_untag(troot, EB_LEAF),
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ebtree/src/ebtree.h:276:68: note: expanded from macro 'container_of'
#define container_of(ptr, type, name) ((type *)(((void *)(ptr)) - ((long)&((type *)0)->name)))
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~
ebtree/src/eb128tree.c:1141:12: warning: cast to smaller integer type 'long' from 'struct eb_node *' [-Wpointer-to-int-cast]
                                return eb128_entry(eb_walk_down(troot, EB_LEFT), struct eb128_node, node);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ebtree/src/eb128tree.c:497:40: note: expanded from macro 'eb128_entry'
#define eb128_entry(ptr, type, member) container_of(ptr, type, member)
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ebtree/src/ebtree.h:276:68: note: expanded from macro 'container_of'
#define container_of(ptr, type, name) ((type *)(((void *)(ptr)) - ((long)&((type *)0)->name)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant