JustasMasiulis / xorstr

heavily vectorized c++17 compile time string encryption.
Apache License 2.0
1.19k stars 193 forks source link

compiling with clang gives 2 errors #31

Closed beranos closed 3 years ago

beranos commented 4 years ago

hi i'm trying to compile this with clang but i'm getting the following errors ( 2 ):

xorstr.h(184,28): error : definition with same mangled name '??0?$xor_string@U?$tstring_@$0CO@$0GK@$0GB@$0HC@$0A@@detail@jm@@U?$_ki@$0A@$0?GKNNEFCACGHIFHND@@23@U?$_ki@$00$0?CMAMICDJGCBFOCDK@@23@@jm@@QEAA@XZ' as another definition
xorstr.h(194,33): error : definition with same mangled name '?crypt@?$xor_string@U?$tstring_@$0CO@$0GK@$0GB@$0HC@$0A@@detail@jm@@U?$_ki@$0A@$0?GKNNEFCACGHIFHND@@23@U?$_ki@$00$0?CMAMICDJGCBFOCDK@@23@@jm@@QEAAXXZ' as another definition

i can build this fine with msvc tho

JustasMasiulis commented 4 years ago

Will take a look once I get back home

JustasMasiulis commented 4 years ago

Is there any chance you can get me a minimal recreation? Or at least some more info like the compiler version?

beranos commented 4 years ago

Is there any chance you can get me a minimal recreation? Or at least some more info like the compiler version?

how can i get the compiler version? i'm guessing it's the last one since i downloaded it from the visual studio installer 2/3 weeks ago

JustasMasiulis commented 4 years ago

can't really recreate man. I need something more concrete like a reproduction

beranos commented 4 years ago

i guess this can be closed then, it must be a problem with my project but the project is so big so i don't even know what can use it.

JustasMasiulis commented 4 years ago

Sorry that I couldn't help. Haven't ever even seen that error before 🤷

beranos commented 3 years ago

Sorry that I couldn't help. Haven't ever even seen that error before 🤷

found out why that happend, i had a line that did this: if (x) return xorstr_(L"empty");

removing that line fixed that error btw i use that exact same string somewhere else but without wide character literals and wide-character string and removing that i get no error with the code above

JustasMasiulis commented 3 years ago
if (x)
     return xorstr_(L"empty");

This is not valid usage in the first place. It returns a pointer to buffer that was in the called functions frame.

249383 commented 3 years ago

ok

Justas Masiulis notifications@github.com 于 2020年9月26日周六 下午8:48写道:

if (x) return xorstr_(L"empty");

This is not valid usage in the first place. It returns a pointer to buffer that was in the called functions frame.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/JustasMasiulis/xorstr/issues/31#issuecomment-699491333, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQVYBZTCC4JDQVMKU653LBTSHXPJVANCNFSM4QLJR6GA .