Discussion:
"cast increases required alignment of target type" build warnings on ARM
Mirko Augsburger
2011-09-11 13:17:30 UTC
Permalink
Hi!

I just compiled the pu branch on my debian ARM system and got the
warning several times. I don't know what is means but cmus is running
fine, great work! :)

`--> make
CC browser.o
CC cmus.o
CC command_mode.o
CC comment.o
CC help.o
CC id3.o
CC input.o
CC lib.o
lib.c: In function 'to_sorted':
lib.c:60: warning: cast increases required alignment of target type
lib.c: In function 'aaa_mode_filter':
lib.c:201: warning: cast increases required alignment of target type
lib.c: In function 'free_lib_track':
lib.c:312: warning: cast increases required alignment of target type
lib.c: In function 'lib_set_next':
lib.c:361: warning: cast increases required alignment of target type
lib.c: In function 'lib_set_prev':
lib.c:381: warning: cast increases required alignment of target type
lib.c: In function 'lib_find_track':
lib.c:427: warning: cast increases required alignment of target type
CC options.o
CC output.o
CC pl.o
pl.c: In function 'pl_free_track':
pl.c:32: warning: cast increases required alignment of target type
pl.c: In function 'pl_set_next':
pl.c:74: warning: cast increases required alignment of target type
pl.c: In function 'pl_set_prev':
pl.c:90: warning: cast increases required alignment of target type
CC player.o
player.c: In function 'scale_samples':
player.c:328: warning: cast increases required alignment of target type
player.c:335: warning: cast increases required alignment of target type
CC server.o
CC search.o
CC track.o
CC tree.o
CC ui_curses.o
LD cmus
CC mad.lo
CC nomad.lo
LD mad.so
CC wavpack.lo
LD wavpack.so
CC aac.lo
LD aac.so
MAN Doc/cmus.1
make 67,71s user 2,15s system 68% cpu 1:42,59 total

`--> uname -a
Linux mists-music-box 2.6.32-5-kirkwood #1 Tue Jun 14 23:05:32 UTC 2011 armv5tel GNU/Linux
Johannes Weißl
2011-09-17 12:52:30 UTC
Permalink
Hi Mirko,
Post by Mirko Augsburger
I just compiled the pu branch on my debian ARM system and got the
warning several times. I don't know what is means but cmus is running
fine, great work! :)
Thanks :-)! I tried to fix those warnings several months ago, but I
couldn't find a fast and 100% standard compliant way to do it.
I tried replacing most of them with union casts, but it wasn't perfectly
standard compliant. It got rid of all the warnings though. You can try
it here:
https://gitorious.org/~jmuc/cmus/jw-cmus/commits/align

If there is a C guru here, I would love to hear his/hers thoughts about
this!


Johannes
Gregory Petrosyan
2011-09-26 07:33:55 UTC
Permalink
Post by Johannes Weißl
Hi Mirko,
Post by Mirko Augsburger
I just compiled the pu branch on my debian ARM system and got the
warning several times. I don't know what is means but cmus is running
fine, great work! :)
Thanks :-)! I tried to fix those warnings several months ago, but I
couldn't find a fast and 100% standard compliant way to do it.
I tried replacing most of them with union casts, but it wasn't perfectly
standard compliant. It got rid of all the warnings though. You can try
https://gitorious.org/~jmuc/cmus/jw-cmus/commits/align
If there is a C guru here, I would love to hear his/hers thoughts about
this!
I tried fixind those some time ago, too. It was not a 100% success (I tried to
avoid casting that generates the warnings — use int16[] instead of int8[]
etc.), and the code is on the dead laptop now.

I am not sure what is the proper way to deal with the issue. Unions make code
look a bit ugly IMO. Maybe we should just live it as-is, for now.

P.S. It is interesting how Linux kernel deals with it. Maybe they just disable
this warning? If so, it looks like the way to go :-)

Gregory
Mirko Augsburger
2011-09-26 08:52:14 UTC
Permalink
Hi,
Post by Johannes Weißl
https://gitorious.org/~jmuc/cmus/jw-cmus/commits/align
I got the branch, but still get the warnings
CC browser.o
CC buffer.o
CC cache.o
CC cmdline.o
CC cmus.o
CC command_mode.o
CC comment.o
CC channelmap.o
CC convert.lo
CC debug.o
CC discid.o
CC editable.o
CC expr.o
CC filters.o
CC format_print.o
CC gbuf.o
CC glob.o
CC help.o
CC history.o
CC http.o
CC id3.o
CC input.o
CC job.o
CC keys.o
CC keyval.o
CC lib.o
lib.c: In function 'to_sorted':
lib.c:60: warning: cast increases required alignment of target type
lib.c: In function 'aaa_mode_filter':
lib.c:201: warning: cast increases required alignment of target type
lib.c: In function 'free_lib_track':
lib.c:312: warning: cast increases required alignment of target type
lib.c: In function 'lib_set_next':
lib.c:361: warning: cast increases required alignment of target type
lib.c: In function 'lib_set_prev':
lib.c:381: warning: cast increases required alignment of target type
lib.c: In function 'lib_find_track':
lib.c:427: warning: cast increases required alignment of target type
CC load_dir.o
CC locking.o
CC mergesort.o
CC misc.o
CC options.o
CC output.o
CC pcm.o
CC pl.o
pl.c: In function 'pl_free_track':
pl.c:32: warning: cast increases required alignment of target type
pl.c: In function 'pl_set_next':
pl.c:74: warning: cast increases required alignment of target type
pl.c: In function 'pl_set_prev':
pl.c:90: warning: cast increases required alignment of target type
CC play_queue.o
CC player.o
CC rbtree.o
CC server.o
CC search.o
CC search_mode.o
CC tabexp.o
CC tabexp_file.o
CC track.o
CC track_info.o
CC tree.o
CC u_collate.o
CC uchar.o
CC ui_curses.o
CC window.o
CC worker.o
CC xstrjoin.o
CC file.o
CC path.o
CC prog.o
CC xmalloc.o
CC ape.o
LD cmus
CC main.o
LD cmus-remote
CC flac.lo
LD flac.so
CC mad.lo
CC nomad.lo
LD mad.so
CC modplug.lo
LD modplug.so
CC mpc.lo
LD mpc.so
CC vorbis.lo
LD vorbis.so
CC wavpack.lo
LD wavpack.so
CC wav.lo
LD wav.so
CC aac.lo
LD aac.so
CC ffmpeg.lo
ffmpeg.c: In function 'ffmpeg_fill_buffer':
ffmpeg.c:344: warning: cast increases required alignment of target type
LD ffmpeg.so
CC pulse.lo
LD pulse.so
CC alsa.lo
CC mixer_alsa.lo
LD alsa.so
CC oss.lo
CC mixer_oss.lo
LD oss.so
CC ao.lo
LD ao.so
make 128,25s user 6,02s system 67% cpu 3:19,31 total

Mirko

Loading...