diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2012-02-29 21:40:53 +0400 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2012-02-29 21:40:53 +0400 |
commit | 5e4f599b440bf2f109c185c42e5c01e24fac18fe (patch) | |
tree | b8e655be5aa3ed681f9e11f29375483e9abbb914 /tools | |
parent | 26aec11628a60a5ac92ba7a55e729b5d0138c85c (diff) | |
download | bdwgc-5e4f599b440bf2f109c185c42e5c01e24fac18fe.tar.gz |
tools: Prevent compiler warnings regarding unused argument and printf
* tools/if_mach.c (main): Remove unused "envp" argument.
* tools/if_not_there.c (main): Likewise.
* tools/if_mach.c: Expand tabs to spaces.
* tools/if_not_there.c: Likewise.
* tools/setjmp_t.c (getpagesize): Define for Win32; include windows.h.
* tools/setjmp_t.c (main): Make printf() format specifier string
non-empty (to suppress compiler warning).
* tools/setjmp_t.c (main): Adjust printf() format specifier for WORDSZ
value (unsigned long instead of int).
Diffstat (limited to 'tools')
-rw-r--r-- | tools/if_mach.c | 4 | ||||
-rw-r--r-- | tools/if_not_there.c | 8 | ||||
-rw-r--r-- | tools/setjmp_t.c | 12 |
3 files changed, 16 insertions, 8 deletions
diff --git a/tools/if_mach.c b/tools/if_mach.c index d3763b60..25f3eca3 100644 --- a/tools/if_mach.c +++ b/tools/if_mach.c @@ -5,7 +5,7 @@ # include <string.h> # include <unistd.h> -int main(int argc, char **argv, char **envp) +int main(int argc, char **argv) { if (argc < 4) goto Usage; if (strcmp(MACH_TYPE, argv[1]) != 0) return(0); @@ -19,6 +19,6 @@ int main(int argc, char **argv, char **envp) Usage: fprintf(stderr, "Usage: %s mach_type os_type command\n", argv[0]); fprintf(stderr, "Currently mach_type = %s, os_type = %s\n", - MACH_TYPE, OS_TYPE); + MACH_TYPE, OS_TYPE); return(1); } diff --git a/tools/if_not_there.c b/tools/if_not_there.c index b71394c3..cae4880d 100644 --- a/tools/if_not_there.c +++ b/tools/if_not_there.c @@ -1,5 +1,5 @@ /* Conditionally execute a command based if the file argv[1] doesn't exist */ -/* Except for execvp, we stick to ANSI C. */ +/* Except for execvp, we stick to ANSI C. */ # include "private/gcconfig.h" # include <stdio.h> # include <stdlib.h> @@ -8,7 +8,7 @@ #include <dirent.h> #endif /* __DJGPP__ */ -int main(int argc, char **argv, char **envp) +int main(int argc, char **argv) { FILE * f; #ifdef __DJGPP__ @@ -22,8 +22,8 @@ int main(int argc, char **argv, char **envp) } #ifdef __DJGPP__ if ((d = opendir(argv[1])) != 0) { - closedir(d); - return(0); + closedir(d); + return(0); } #endif printf("^^^^Starting command^^^^\n"); diff --git a/tools/setjmp_t.c b/tools/setjmp_t.c index 0952fb03..7a1e285f 100644 --- a/tools/setjmp_t.c +++ b/tools/setjmp_t.c @@ -45,6 +45,14 @@ int getpagesize(void) } return((int)(result[0])); } +#elif defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32) +# include <windows.h> + int getpagesize(void) + { + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + return sysinfo.dwPageSize; + } #endif struct { @@ -89,7 +97,7 @@ int main(void) printf("Results may not be accurate/useful:\n"); /* Encourage the compiler to keep x in a callee-save register */ x = 2*x-1; - printf(""); + printf("\n"); x = 2*x-1; setjmp(b); if (y == 1) { @@ -107,7 +115,7 @@ int main(void) x = 2; if (y == 1) longjmp(b,1); printf("Some GC internal configuration stuff: \n"); - printf("\tWORDSZ = %d, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n", + printf("\tWORDSZ = %lu, ALIGNMENT = %d, GC_GRANULE_BYTES = %d\n", WORDSZ, ALIGNMENT, GC_GRANULE_BYTES); printf("\tUsing one mark "); # if defined(USE_MARK_BYTES) |