Fix warnings and set -Werror

release-v1.0.0
Richard van der Hoff 2016-05-18 18:03:28 +01:00
parent ea130cae0d
commit e21d5cb222
3 changed files with 6 additions and 6 deletions

View File

@ -24,9 +24,9 @@ JS_PRE := $(wildcard javascript/*pre.js)
JS_POST := $(wildcard javascript/*post.js)
CPPFLAGS += -Iinclude -Ilib
CFLAGS += -Wall -std=c89 -fPIC
CXXFLAGS += -Wall -std=c++11 -fPIC
LDFLAGS += -Wall
CFLAGS += -Wall -Werror -std=c89 -fPIC
CXXFLAGS += -Wall -Werror -std=c++11 -fPIC
LDFLAGS += -Wall -Werror
EMCCFLAGS = --closure 1 --memory-init-file 0 -s NO_FILESYSTEM=1 -s INVOKE_RUN=0
# NO_BROWSER is kept for compatibility with emscripten 1.35.24, but is no

View File

@ -67,7 +67,7 @@ int main() {
{
TestCase my_test("Olm decrypt test");
for (int i = 0; i < sizeof(test_cases)/ sizeof(const char *); ++i) {
for (unsigned int i = 0; i < sizeof(test_cases)/ sizeof(const char *); ++i) {
decrypt_case(0, test_cases[i]);
}

View File

@ -195,7 +195,7 @@ std::uint8_t random[] = "This is a random 32 byte string";
for (unsigned i = 0; i < 8; ++i) {
{
std::uint8_t msg[alice.encrypt_output_length(sizeof(plaintext))];
std::uint8_t encrypt_length = alice.encrypt(
alice.encrypt(
plaintext, 15, random, 32, msg, sizeof(msg)
);
std::uint8_t output[bob.decrypt_max_plaintext_length(msg, sizeof(msg))];
@ -206,7 +206,7 @@ for (unsigned i = 0; i < 8; ++i) {
random[31]++;
{
std::uint8_t msg[bob.encrypt_output_length(sizeof(plaintext))];
std::uint8_t encrypt_length = bob.encrypt(
bob.encrypt(
plaintext, 15, random, 32, msg, sizeof(msg)
);
std::uint8_t output[alice.decrypt_max_plaintext_length(msg, sizeof(msg))];