[Fix] Gcc-9 complaning about parentheses
authorJihoon Lee <jhoon.it.lee@samsung.com>
Tue, 2 Mar 2021 04:12:52 +0000 (04:12 +0000)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 2 Mar 2021 04:59:17 +0000 (13:59 +0900)
Because of unclear parentheses on the `ErrorNotification`
gcc-9 issued a warning about the `NNTR_THROW_IF_CLEANUP` macro, when
no stream is given.

This patch fixes the issue.

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/nntrainer_error.h

index ff0759c..2cfd7cc 100644 (file)
 
 #define NNTR_THROW_IF(pred, err) \
   if ((pred))                    \
-  nntrainer::exception::internal::ErrorNotification<err>()
+    nntrainer::exception::internal::ErrorNotification<err> {}
 
 #define NNTR_THROW_IF_CLEANUP(pred, err, cleanup_func) \
   if ((pred))                                          \
-  nntrainer::exception::internal::ErrorNotification<err>(cleanup_func)
+    nntrainer::exception::internal::ErrorNotification<err> { cleanup_func }
 
 namespace nntrainer {