Skip to content

Instantly share code, notes, and snippets.

@Rondom
Created October 7, 2017 12:49
Show Gist options
  • Save Rondom/0a0c46d7a094959597bcecf7e29a7746 to your computer and use it in GitHub Desktop.
Save Rondom/0a0c46d7a094959597bcecf7e29a7746 to your computer and use it in GitHub Desktop.
MingW-W64 64bit-warnings
/home/andreas/cvs/dumb/src/it/readpsm.c: In function ‘it_psm_process_pattern’:
/home/andreas/cvs/dumb/src/it/readpsm.c:488:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
/home/andreas/cvs/dumb/src/it/readpsm.c:488:46: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
[ 37%] Building C object CMakeFiles/dumb.dir/src/it/readoldpsm.c.obj
[ 38%] Building C object CMakeFiles/dumb.dir/src/it/readokt2.c.obj
[ 39%] Building C object CMakeFiles/dumb.dir/src/it/readokt.c.obj
[ 40%] Building C object CMakeFiles/dumb.dir/src/it/readmtm.c.obj
[ 41%] Building C object CMakeFiles/dumb.dir/src/it/readmod2.c.obj
[ 43%] Building C object CMakeFiles/dumb.dir/src/it/readmod.c.obj
[ 44%] Building C object CMakeFiles/dumb.dir/src/it/readdsmf.c.obj
/home/andreas/cvs/dumb/src/it/readdsmf.c: In function ‘it_riff_dsmf_process_pattern’:
/home/andreas/cvs/dumb/src/it/readdsmf.c:205:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
/home/andreas/cvs/dumb/src/it/readdsmf.c:205:46: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
[ 45%] Building C object CMakeFiles/dumb.dir/src/it/readasy.c.obj
[ 46%] Building C object CMakeFiles/dumb.dir/src/it/readamf2.c.obj
[ 47%] Building C object CMakeFiles/dumb.dir/src/it/readamf.c.obj
[ 48%] Building C object CMakeFiles/dumb.dir/src/it/readam.c.obj
/home/andreas/cvs/dumb/src/it/readam.c: In function ‘it_riff_am_process_pattern’:
/home/andreas/cvs/dumb/src/it/readam.c:258:32: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
/home/andreas/cvs/dumb/src/it/readam.c:258:46: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
pattern->n_entries = (int)((long)entry - (long)pattern->entry);
^
@SimonN
Copy link

SimonN commented Oct 7, 2017

From freenode #allegro:

Interesting. We have this history: your 64-bit patch, kode fixes warnings, my ssize_t patch, kode fixes warnings. IIRC in one of these 4, n_entries changed from int to size_t, which I would have liked to avoid because it touches magic music rendering.

My reason to change int n_entries to size_t entries: it reduced a ton of warnings that otherwise had required many explicit casts.

Ideally, the entire codebase gets an overhaul with fixed-width ints, explicit truncation, and 0 warnings with -Wconversion. But that's the stuff of dreams :)

Use your best judgement for that warning, I'll be open to discuss solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment