Add additional GCC definitions for more warnings 07/208807/2 submit/tizen/20190704.134431
authorTomasz Swierczek <t.swierczek@samsung.com>
Fri, 28 Jun 2019 12:28:31 +0000 (14:28 +0200)
committerTomasz Swierczek <t.swierczek@samsung.com>
Fri, 28 Jun 2019 12:49:44 +0000 (14:49 +0200)
Removed new warnings/fixed raised issues too.

Change-Id: I44fd371d85ded5335874c4ecb707787c0cab6f1d

CMakeLists.txt
shared/protobuf_asio.h
tests/example_capi.c
tests/example_client.cpp

index 98799bad1623ea759115c83a2ae5274963100db0..04b51481e77c836754a839987833d6e9d84fb387 100644 (file)
@@ -32,6 +32,10 @@ find_package(Threads REQUIRED)
 INCLUDE(cmake/CheckFrameworks.cmake)
 INCLUDE(cmake/CStandard.cmake)
 
+ADD_DEFINITIONS("-Werror")
+ADD_DEFINITIONS("-Wall")
+ADD_DEFINITIONS("-Wextra")
+
 SET(CMAKE_POSITION_INDEPENDENT_CODE "True")
 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie")
 
index 971635770e5d0a065e90ecb75ee3c8307c8661df..c92118646bd876c991b6262eeefc8b9fe3d4b59f 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************
  *
- * Copyright 2017 Samsung Electronics All Rights Reserved.
+ * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
  *
  * Author: Jaroslaw Pelczar <j.pelczar@samsung.com>
  *
@@ -81,6 +81,7 @@ public:
                                [this, handler, &socket](const boost::system::error_code& error, std::size_t bytes_read) {
                                        if(!error) {
                                                assert(bytes_read == fBuffer.size());
+                                               (void)bytes_read;
                                                assert(fMessageLength == 0);
 
                                                google::protobuf::io::CodedInputStream::ReadLittleEndian32FromArray(
index 03d2559e50d1bcff150d7a43c4debed864905644..97ddc03960a1270f664bb55fd502c091327601d2 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************
  *
- * Copyright 2017 - 2018 Samsung Electronics All Rights Reserved.
+ * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char ** argv)
+int main()
 {
        int result;
        void *key_ctx = NULL;
@@ -66,7 +66,7 @@ int main(int argc, char ** argv)
                goto exit;
        }
 
-       for(int i = 0; i < signature_len; i++) {
+       for(unsigned int i = 0; i < signature_len; i++) {
                printf("%x ", (int)(*(unsigned char*)(&signature[i])));
        }
        printf("\n");
index 1ea1e891d310d931401b1515e7dbde92eb5ec5b8..2a0f489b38dc66307ab4a91fbf2f476393a51828 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************
  *
- * Copyright 2017 - 2018 Samsung Electronics All Rights Reserved.
+ * Copyright 2017 - 2019 Samsung Electronics All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
 #include <iostream>
 #include <iomanip>
 
-int main(int argc, char ** argv)
+int main()
 {
        std::shared_ptr<dcm_client_connection> connection;
        try {