diff --git a/config/opal_check_alt_short_float.m4 b/config/opal_check_alt_short_float.m4
index bbdfcad2825017b35104def34719f69f8d847def..c816f7e4263c900e05d62cadfec137602311c7c2 100644
--- a/config/opal_check_alt_short_float.m4
+++ b/config/opal_check_alt_short_float.m4
@@ -2,6 +2,8 @@ dnl -*- shell-script -*-
 dnl
 dnl Copyright (c) 2018-2020 FUJITSU LIMITED.  All rights reserved.
 dnl Copyright (c) 2020 Cisco Systems, Inc.  All rights reserved.
+dnl Copyright (c) 2021      Triad National Security, LLC. All rights
+dnl                         reserved.
 dnl $COPYRIGHT$
 dnl
 dnl Additional copyrights may follow
@@ -14,7 +16,16 @@ dnl Check whether the user wants to use an alternate type of C 'short float'.
 dnl OPAL_CHECK_ALT_SHORT_FLOAT
 dnl ------------------------------------------------------------
 AC_DEFUN([OPAL_CHECK_ALT_SHORT_FLOAT], [
+dnl
+dnl Testing for this without checking if compiler generates warnings makes for a messy build.
+dnl Hence the twiddling of the CFLAGS
+dnl
+    OPAL_VAR_SCOPE_PUSH([CFLAGS_save])
+    CFLAGS_save=$CFLAGS
+    CFLAGS="-Werror $CFLAGS"
     AC_CHECK_TYPES(_Float16)
+    CFLAGS=$CFLAGS_save
+    OPAL_VAR_SCOPE_POP
     AC_MSG_CHECKING([if want alternate C type of short float])
     AC_ARG_ENABLE([alt-short-float],
         [AS_HELP_STRING([--enable-alt-short-float=TYPE],