In compilers/imcc/main.c, there are several cases of where 0 is used
as an enum value without being cast. This causes warnings in the
Intel C++ compiler. The patch below silences these warnings.
Steve Peters
st...@fisharerojo.org
--- compilers/imcc/main.c.old 2007-01-03 22:51:53.000000000 -0600
+++ compilers/imcc/main.c 2007-01-03 22:55:53.000000000 -0600
@@ -153,35 +153,35 @@
#define OPT_RUNTIME_PREFIX 132
static struct longopt_opt_decl options[] = {
- { '.', '.', 0, { "--wait" } },
- { 'C', 'C', 0, { "--CGP-core" } },
+ { '.', '.', (OPTION_flags)0, { "--wait" } },
+ { 'C', 'C', (OPTION_flags)0, { "--CGP-core" } },
{ 'D', 'D', OPTION_optional_FLAG, { "--parrot-debug" } },
- { 'E', 'E', 0, { "--pre-process-only" } },
- { 'G', 'G', 0, { "--no-gc" } },
+ { 'E', 'E', (OPTION_flags)0, { "--pre-process-only" } },
+ { 'G', 'G', (OPTION_flags)0, { "--no-gc" } },
{ 'O', 'O', OPTION_optional_FLAG, { "--optimize" } },
- { 'S', 'S', 0, { "--switched-core" } },
- { 'V', 'V', 0, { "--version" } },
- { '\0', OPT_DESTROY_FLAG, 0, { "--leak-test", "--destroy-at-end" } },
- { '\0', OPT_GC_DEBUG, 0, { "--gc-debug" } },
- { 'a', 'a', 0, { "--pasm" } },
- { 'b', 'b', 0, { "--bounds-checks", "--slow-core" } },
- { 'c', 'c', 0, { "--pbc" } },
+ { 'S', 'S', (OPTION_flags)0, { "--switched-core" } },
+ { 'V', 'V', (OPTION_flags)0, { "--version" } },
+ { '\0', OPT_DESTROY_FLAG, (OPTION_flags)0, { "--leak-test", "--destroy-at-end" } },
+ { '\0', OPT_GC_DEBUG, (OPTION_flags)0, { "--gc-debug" } },
+ { 'a', 'a', (OPTION_flags)0, { "--pasm" } },
+ { 'b', 'b', (OPTION_flags)0, { "--bounds-checks", "--slow-core" } },
+ { 'c', 'c', (OPTION_flags)0, { "--pbc" } },
{ 'd', 'd', OPTION_optional_FLAG, { "--imcc-debug" } },
- { '\0', OPT_HELP_DEBUG, 0, { "--help-debug" } },
- { 'f', 'f', 0, { "--fast-core" } },
- { 'g', 'g', 0, { "--computed-goto-core" } },
- { 'h', 'h', 0, { "--help" } },
- { 'j', 'j', 0, { "--jit-core" } },
+ { '\0', OPT_HELP_DEBUG, (OPTION_flags)0, { "--help-debug" } },
+ { 'f', 'f', (OPTION_flags)0, { "--fast-core" } },
+ { 'g', 'g', (OPTION_flags)0, { "--computed-goto-core" } },
+ { 'h', 'h', (OPTION_flags)0, { "--help" } },
+ { 'j', 'j', (OPTION_flags)0, { "--jit-core" } },
{ 'o', 'o', OPTION_required_FLAG, { "--output" } },
- { '\0', OPT_PBC_OUTPUT, 0, { "--output-pbc" } },
- { 'p', 'p', 0, { "--profile" } },
- { 'r', 'r', 0, { "--run-pbc" } },
- { '\0', OPT_RUNTIME_PREFIX, 0, { "--runtime-prefix" } },
+ { '\0', OPT_PBC_OUTPUT, (OPTION_flags)0, { "--output-pbc" } },
+ { 'p', 'p', (OPTION_flags)0, { "--profile" } },
+ { 'r', 'r', (OPTION_flags)0, { "--run-pbc" } },
+ { '\0', OPT_RUNTIME_PREFIX, (OPTION_flags)0, { "--runtime-prefix" } },
{ 't', 't', OPTION_optional_FLAG, { "--trace" } },
- { 'v', 'v', 0, { "--verbose" } },
- { 'w', 'w', 0, { "--warnings" } },
- { 'y', 'y', 0, { "--yydebug" } },
- { 0, 0, 0, { NULL } }
+ { 'v', 'v', (OPTION_flags)0, { "--verbose" } },
+ { 'w', 'w', (OPTION_flags)0, { "--warnings" } },
+ { 'y', 'y', (OPTION_flags)0, { "--yydebug" } },
+ { 0, 0, (OPTION_flags)0, { NULL } }
};
static int
Thanks,
Jonathan