JustasMasiulis / xorstr

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

Ignore GCC attributes warning #1

Closed no-realm closed 6 years ago

no-realm commented 6 years ago

@JustasMasiulis I have moved the alignas() attribute to after the identifier to fix the GCC warning.

JustasMasiulis commented 6 years ago

Oh nono I meant it like this alignas(detail::buffer_align<T>()) XORSTR_VOLATILE std::uint64_t _storage[detail::buffer_size<T>()]; because this doesn't even compile 😄

no-realm commented 6 years ago

Yeah, also noticed that it doesn't compile with apple-clang for me, but GCC-8 works just fine.

The problem is that when I use the PR or your version with apple-clang, I get the following error:

error: implicit instantiation of undefined template error: implicit instantiation of undefined template 'jm::detail::string_builder<char, jm::detail::tstring_<char>, 't', 'e', 's', 't', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00', '\x00'>'
JustasMasiulis commented 6 years ago

Seems to work just fine on newest versions of clang for me. What version were you using?

no-realm commented 6 years ago

Here is the version output.

$ clang -v
Apple LLVM version 9.0.0 (clang-900.0.37)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

It's possible that it is outdated, since I haven't updated my Xcode installation for quite some time. I will try it again after doing so, but will likely take some time, since I am not on my home network at the moment, and currently have a very slow connection.

Update: So, I have tried compiling with latest clang-6.0.1 and it seems to work. I have changed the alignas() position to the front.

JustasMasiulis commented 6 years ago

Merged. Thanks for the contribution :+1: