fix broken compiler detection when warning level is high - fixes #686

Wed, 12 Nov 2025 20:26:10 +0100

author
Mike Becker <universe@uap-core.de>
date
Wed, 12 Nov 2025 20:26:10 +0100
changeset 157
eb788903e8c6
parent 156
75627f46495d
child 158
10c95fc02326

fix broken compiler detection when warning level is high - fixes #686

src/main/resources/make/toolchain.sh file | annotate | diff | comparison | revisions
test/make/toolchain.sh file | annotate | diff | comparison | revisions
--- a/src/main/resources/make/toolchain.sh	Wed Nov 12 20:15:44 2025 +0100
+++ b/src/main/resources/make/toolchain.sh	Wed Nov 12 20:26:10 2025 +0100
@@ -30,7 +30,7 @@
   cat > "$TEMP_DIR/test.c" << __EOF__
 /* test file */
 #include <stdio.h>
-int main(int argc, char **argv) {
+int main(void) {
 #if defined(_MSC_VER)
   printf("toolchain:msc\n");
 #elif defined(__clang__)
@@ -44,7 +44,7 @@
 #endif
   printf("wsize:%d\n", (int)sizeof(void*)*8);
 #ifdef __STDC_VERSION__
-  printf("stdcversion:%d\n", __STDC_VERSION__);
+  printf("stdcversion:%ld\n", (long int)__STDC_VERSION__);
 #endif
   return 0;
 }
@@ -61,7 +61,7 @@
   cat > "$TEMP_DIR/test.cpp" << __EOF__
 /* test file */
 #include <iostream>
-int main(int argc, char **argv) {
+int main(void) {
 #if defined(_MSC_VER)
   std::cout << "toolchain:msc" << std::endl;
 #elif defined(__clang__)
--- a/test/make/toolchain.sh	Wed Nov 12 20:15:44 2025 +0100
+++ b/test/make/toolchain.sh	Wed Nov 12 20:26:10 2025 +0100
@@ -30,7 +30,7 @@
   cat > "$TEMP_DIR/test.c" << __EOF__
 /* test file */
 #include <stdio.h>
-int main(int argc, char **argv) {
+int main(void) {
 #if defined(_MSC_VER)
   printf("toolchain:msc\n");
 #elif defined(__clang__)
@@ -44,7 +44,7 @@
 #endif
   printf("wsize:%d\n", (int)sizeof(void*)*8);
 #ifdef __STDC_VERSION__
-  printf("stdcversion:%d\n", __STDC_VERSION__);
+  printf("stdcversion:%ld\n", (long int)__STDC_VERSION__);
 #endif
   return 0;
 }
@@ -61,7 +61,7 @@
   cat > "$TEMP_DIR/test.cpp" << __EOF__
 /* test file */
 #include <iostream>
-int main(int argc, char **argv) {
+int main(void) {
 #if defined(_MSC_VER)
   std::cout << "toolchain:msc" << std::endl;
 #elif defined(__clang__)

mercurial