Skip to content
Snippets Groups Projects
Commit cf8e77ab authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Fix new clang warnings.

parent 4fcf8c73
No related branches found
No related tags found
No related merge requests found
......@@ -313,6 +313,16 @@ AC_CACHE_CHECK([whether __builtin_complex is available],
[AS_VAR_SET([acx_cv_have_decl___builtin_complex],[yes])],
[AS_VAR_SET([acx_cv_have_decl___builtin_complex],[no])])])
ACX_CHECK_ASM_BSR
AC_CACHE_CHECK([whether __builtin_unreachable is declared],
[acx_cv_have_decl___builtin_unreachable],
[AC_LINK_IFELSE([AC_LANG_PROGRAM(,[ int v;
scanf("%d", &v);
if (v < 0) __builtin_unreachable()])],
[AS_VAR_SET([acx_cv_have_decl___builtin_unreachable],[yes])],
[AS_VAR_SET([acx_cv_have_decl___builtin_unreachable],[no])])])
AC_DEFINE_UNQUOTED([HAVE_DECL___BUILTIN_UNREACHABLE],
[`test "$acx_cv_have_decl___builtin_unreachable" = yes ; expr 1 - $?`],
[GCC style __builtin_unreachable is available])
dnl ######################################################################
dnl Test whether cfortran.h works correctly
dnl ######################################################################
......
......@@ -729,6 +729,10 @@ static void xt_ddt_tree_elem_delete(struct xt_ddt_tree_elem *elem) {
case MULTI_SUB:
num_sub_elem = elem->displ_count;
break;
# if HAVE_DECL___BUILTIN_UNREACHABLE && !__clang__
default:
__builtin_unreachable();
# endif
}
struct xt_ddt_tree_elem **sub_elems
= (struct xt_ddt_tree_elem **)(elem->displs + elem->displ_count);
......@@ -813,6 +817,10 @@ static void xt_ddt_tree_elem_get_data_sizes(
sub_elems[i], prev_dtype, prev_data_idx, data);
break;
}
# if HAVE_DECL___BUILTIN_UNREACHABLE && !__clang__
default:
__builtin_unreachable();
# endif
}
}
......@@ -878,6 +886,10 @@ static void xt_ddt_tree_elem_to_data(
prev_dtype, prev_data_idx);
break;
}
# if HAVE_DECL___BUILTIN_UNREACHABLE && !__clang__
default:
__builtin_unreachable();
# endif
}
}
......
......@@ -195,6 +195,12 @@ xt_idxlist_collection_new(Xt_idxlist *idxlists, int num_idxlists) {
case -1:
++nsort_dsc;
break;
case 0:
break;
# if HAVE_DECL___BUILTIN_UNREACHABLE
default:
__builtin_unreachable();
# endif
}
for (int i = (int)first_non_empty_idxlist+1; i < num_idxlists; ++i) {
int num_indices_of_list = xt_idxlist_get_num_indices(idxlists[i]);
......@@ -215,6 +221,12 @@ xt_idxlist_collection_new(Xt_idxlist *idxlists, int num_idxlists) {
case -1:
++nsort_dsc;
break;
case 0:
break;
# if HAVE_DECL___BUILTIN_UNREACHABLE
default:
__builtin_unreachable();
# endif
}
num_indices += num_indices_of_list;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment