celix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [celix] Oipo commented on a change in pull request #139: Add parsing of version and filter on version when calling useService*.
Date Sun, 26 Jan 2020 10:38:12 GMT
Oipo commented on a change in pull request #139: Add parsing of version and filter on version
when calling useService*.
URL: https://github.com/apache/celix/pull/139#discussion_r370988766
 
 

 ##########
 File path: libs/framework/tst/bundle_context_services_test.cpp
 ##########
 @@ -87,7 +87,7 @@ TEST(CelixBundleContextServicesTests, registerMultipleAndUseServices) {
     };
 
     const char *calcName = "calc";
-    struct calc svc;
+    struct calc svc{};
 
 Review comment:
   So the error is actually an error of the g++ 4.x and 5.x series. The warning is used to
indicate class types that are improperly initialized. Since c++11, empty initialization means
[zero initialization for non-union class types](https://en.cppreference.com/w/cpp/language/zero_initialization)
(as is the case here). As this does not lead to half-initialized  Therefore, since version
6.1 ([godbolt](https://godbolt.org/z/T6yuJD)), g++ includes the following exception for this
warning:
   
   `in C++ this option does not warn about the empty { } initializer` [[docs]](https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html)
   
   As it is a hassle to not apply this rule for these few instances, because it is test code
and every time the calc field is properly filled, I will simply revert the changes here.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message