From 4995ec0ba6f15e03deb4b9ad1dc215f3f8993acb Mon Sep 17 00:00:00 2001 From: Luis Fernandez Date: Thu, 21 Feb 2019 14:13:44 -0600 Subject: HB Improvements: Fix compiler warnings on modern compilers Resolve warnings when compiling with gcc 4.8. Compiled with GCC 7.3, no more compile errors/warnings; build ends with caught exception from linker. This commit compiles with GCC 8.2, no more error/warnings; except for a linking warning. Change-Id: Ib5d7c2b5bd350edc76ee2c7de96896154cd44420 RTC: 202716 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/72271 Reviewed-by: Nicholas E. Bofferding Reviewed-by: Ilya Smirnov Tested-by: Jenkins Server Tested-by: FSP CI Jenkins Reviewed-by: Daniel M. Crowell --- src/include/usr/devicefw/driverif.H | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'src/include/usr/devicefw') diff --git a/src/include/usr/devicefw/driverif.H b/src/include/usr/devicefw/driverif.H index e91c43518..048b8dc19 100644 --- a/src/include/usr/devicefw/driverif.H +++ b/src/include/usr/devicefw/driverif.H @@ -405,8 +405,10 @@ namespace DeviceFW TargType i_targetType, deviceOp_t i_regRoute) { - InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(OpType) != sizeof(OpType), "Must use an " + "explicitly supported template specialization"); } /** Assistance macro for stringification. */ @@ -463,8 +465,12 @@ namespace DeviceFW void* io_buffer, size_t& io_buflen, AccType i_accessType, ...) { - return InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(AccType) != sizeof(AccType), "Must use" + " an explicitly supported template specialization"); + errlHndl_t errl = nullptr; + return errl; } /** @@ -488,8 +494,12 @@ namespace DeviceFW void* io_buffer, size_t& io_buflen, AccType i_accessType, va_list i_args) { - return InvalidParameterType(); // Cause a compile fail if not one of - // the explicit template specializations. + // Cause a compile fail if not one of + // the explicit template specializations. + static_assert(sizeof(AccType) != sizeof(AccType), "Must use" + " an explicitly supported template specialization"); + errlHndl_t errl = nullptr; + return errl; } // --- Below are template specializations to aid in type-safety. --- -- cgit v1.2.1