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
Compiler warning due to different string alignments in mqueue.cpp code #591
Comments
Thanks @oPaveo. Yeah, we want to be as warning free as possible. That warning should be contained. It's a bug on our part. It looks like you are taking about this function:
And
How do you feel about doing away with the string literal altogether. Maybe something like:
|
Hello, |
Thanks @oPaveo, Do you want to make a PR, or would you like us to handle it? |
I prefer to leave it to you. |
Thanks again @oPaveo. Cleared at Commit 53ccd310b8b3. |
I use Visual Studio 2017 (msvc15) under Windows 10 and Crypto++ 6.10.
I get the following linker warning:
I know that is the Microsoft compiler problem and I reported it to them.
But I also know why It occures and there is a very simple way to avoid it.
In your code, in
mqueue.cpp
we havereturn Output(1, (const byte *)"\0", 1, 0, blocking) != 0;
The string
"\0"
is actually a two-element array of two zero bytes - exactly the same asL""
. So the problem is whether it is a 1-length char* or an empty wide string.Maybe you can write
return Output(1, (const byte *)"\0\0", 1, 0, blocking) != 0;
or
return Output(1, (const byte *)"", 1, 0, blocking) != 0;
Both codes works the same way and without linker warnings.
P.S. Older versions of Crypto++ give the same effect, of course.
The text was updated successfully, but these errors were encountered: