Issue #17361: Use cc from sysconfig for testing flags.
diff --git a/setup.py b/setup.py
index a70909c..7b7e03e 100644
--- a/setup.py
+++ b/setup.py
@@ -2013,8 +2013,8 @@
 
         # Increase warning level for gcc:
         if 'gcc' in cc:
-            cmd = ("echo '' | gcc -Wextra -Wno-missing-field-initializers -E - "
-                   "> /dev/null 2>&1")
+            cmd = ("echo '' | %s -Wextra -Wno-missing-field-initializers -E - "
+                   "> /dev/null 2>&1" % cc)
             ret = os.system(cmd)
             if ret >> 8 == 0:
                 extra_compile_args.extend(['-Wextra',