Skip to content

Commit

Permalink
tests/ports/windows: temporarily disable some function cast warnings
Browse files Browse the repository at this point in the history
make check in tests/ports/windows got new warnings from -Wcast-function-type
in gcc picky mode.

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Feb 24, 2020
1 parent 94e5a4f commit 38e218b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/hwloc.m4
Expand Up @@ -418,6 +418,7 @@ EOF])
# -Wextra enables some -Wfoo that we want to disable it at some place
_HWLOC_CHECK_GCC_OPTION([-Wmissing-field-initializers], [add], [AC_DEFINE(HWLOC_HAVE_GCC_W_MISSING_FIELD_INITIALIZERS, 1, [Define to 1 if gcc -Wmissing-field-initializers is supported and enabled])])
_HWLOC_CHECK_GCC_OPTION([-Wcast-function-type], [add], [AC_DEFINE(HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE, 1, [Define to 1 if gcc -Wcast-function-type is supported and enabled])])
HWLOC_CFLAGS="$HWLOC_CFLAGS $add"
fi
Expand Down
10 changes: 9 additions & 1 deletion hwloc/topology-windows.c
@@ -1,6 +1,6 @@
/*
* Copyright © 2009 CNRS
* Copyright © 2009-2019 Inria. All rights reserved.
* Copyright © 2009-2020 Inria. All rights reserved.
* Copyright © 2009-2012, 2020 Université Bordeaux
* Copyright © 2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
Expand Down Expand Up @@ -232,6 +232,10 @@ static void hwloc_win_get_function_ptrs(void)
{
HMODULE kernel32;

#if HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif

kernel32 = LoadLibrary("kernel32.dll");
if (kernel32) {
GetActiveProcessorGroupCountProc =
Expand Down Expand Up @@ -270,6 +274,10 @@ static void hwloc_win_get_function_ptrs(void)
if (psapi)
QueryWorkingSetExProc = (PFN_QUERYWORKINGSETEX) GetProcAddress(psapi, "QueryWorkingSetEx");
}

#if HWLOC_HAVE_GCC_W_CAST_FUNCTION_TYPE
#pragma GCC diagnostic warning "-Wcast-function-type"
#endif
}

/*
Expand Down

0 comments on commit 38e218b

Please sign in to comment.