diff options
| author | cremno <[email protected]> | 2014-08-26 00:30:33 +0200 |
|---|---|---|
| committer | cremno <[email protected]> | 2014-08-26 00:30:33 +0200 |
| commit | bdf6ce34ce988a4b293f48e53aa4157db6ef1688 (patch) | |
| tree | 78052a6e25c12946f0b4d231f8bc036212aae3da /src | |
| parent | 73a012c80806c5891579903d1bc1f51b424ce0bf (diff) | |
| download | mruby-bdf6ce34ce988a4b293f48e53aa4157db6ef1688.tar.gz mruby-bdf6ce34ce988a4b293f48e53aa4157db6ef1688.zip | |
printf: cast variables to the expected type
%x expects unsigned int and %p expects void *
GCC emits a diagnostic about %p/void* in pedantic mode:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=26542
Diffstat (limited to 'src')
| -rw-r--r-- | src/codegen.c | 2 | ||||
| -rw-r--r-- | src/parse.y | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/codegen.c b/src/codegen.c index 48ab63de0..b2b1e4150 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -2715,7 +2715,7 @@ codedump(mrb_state *mrb, mrb_irep *irep) int32_t line; if (!irep) return; - printf("irep %p nregs=%d nlocals=%d pools=%d syms=%d reps=%d\n", irep, + printf("irep %p nregs=%d nlocals=%d pools=%d syms=%d reps=%d\n", (void*)irep, irep->nregs, irep->nlocals, (int)irep->plen, (int)irep->slen, (int)irep->rlen); for (i = 0; i < (int)irep->ilen; i++) { diff --git a/src/parse.y b/src/parse.y index 832689bae..0c0a9877f 100644 --- a/src/parse.y +++ b/src/parse.y @@ -6366,7 +6366,7 @@ mrb_parser_dump(mrb_state *mrb, node *tree, int offset) break; default: - printf("node type: %d (0x%x)\n", (int)n, (int)n); + printf("node type: %d (0x%x)\n", n, (unsigned)n); break; } #endif |
