Subject: uade-cvs on Ubuntu

From: Melkor
Date: Thu Jun 29 23:46:08 2006

To: UADE-Developer-discussion
Hi,

This isn't really a bug but I'm sure the UADE team will fix these small warnings for the beauty of clean code :-)

As I was packaging uade-cvs for Ubuntu Dapper, I noticed these warnings when compiling.

The default gcc version in Ubuntu Dapper Drake is :
gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)

Only relevant parts are shown.

[code:1:ad156b4de2]
gcc -Wall -O2 -I../../include -I../common   -g  -c ../common/eagleplayer.c
../common/eagleplayer.c&#58; In function .uade_update_song_conf.&#58;
../common/eagleplayer.c&#58;960&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differ in signedness
../common/eagleplayer.c&#58;963&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differ in signedness
../common/eagleplayer.c&#58;1008&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness
../common/eagleplayer.c&#58;1013&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness

&#91;...&#93;

gcc -Wall -O2 -I../../include -I../common   -g  -c ../common/songinfo.c
../common/songinfo.c&#58; In function .process_WTWT_mod.&#58;
../common/songinfo.c&#58;174&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;182&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;190&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_ahx_mod.&#58;
../common/songinfo.c&#58;215&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;222&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;224&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58; In function .process_ptk_mod.&#58;
../common/songinfo.c&#58;239&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differin signedness
../common/songinfo.c&#58;261&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_digi_mod.&#58;
../common/songinfo.c&#58;287&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;300&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_custom.&#58;
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strncmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strncmp. differ in signedness
../common/songinfo.c&#58;348&#58; warning&#58; pointer targets in assignment differ in signedness
../common/songinfo.c&#58;377&#58; warning&#58; pointer targets in assignment differ in signedness
../common/songinfo.c&#58; In function .process_dm2_mod.&#58;
../common/songinfo.c&#58;417&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differin signedness

&#91;...&#93;

gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I../common -I../../include -c plugin.c
plugin.c&#58; In function .play_loop.&#58;
plugin.c&#58;563&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;564&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;569&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;570&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;580&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;581&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;600&#58; warning&#58; pointer targets in assignment differ in signedness

&#91;...&#93;

gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I../common -I../../include -c ../common/eagleplayer.c
../common/eagleplayer.c&#58; In function .uade_update_song_conf.&#58;
../common/eagleplayer.c&#58;960&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differin signedness
../common/eagleplayer.c&#58;963&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differin signedness
../common/eagleplayer.c&#58;1008&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness
../common/eagleplayer.c&#58;1013&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness

&#91;...&#93;

gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I
/usr/lib/glib/include  -I../common -I../../include -c plugin.c
plugin.c&#58; In function .play_loop.&#58;
plugin.c&#58;563&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;564&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;569&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;570&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;580&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;581&#58; warning&#58; pointer targets in passing argument 2 of .strlcpy. differ in signedness
plugin.c&#58;600&#58; warning&#58; pointer targets in assignment differ in signedness

&#91;...&#93;

gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I../common -I../../include -c ../common/eagleplayer.c
../common/eagleplayer.c&#58; In function .uade_update_song_conf.&#58;
../common/eagleplayer.c&#58;960&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differin signedness
../common/eagleplayer.c&#58;963&#58; warning&#58; pointer targets in passing argument 1 of .strncasecmp. differin signedness
../common/eagleplayer.c&#58;1008&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness
../common/eagleplayer.c&#58;1013&#58; warning&#58; pointer targets in passing argument 1 of .snprintf. differ in signedness

&#91;...&#93;

gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I../common -I../../include -c ../common/songinfo.c
../common/songinfo.c&#58; In function .process_WTWT_mod.&#58;
../common/songinfo.c&#58;174&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;182&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;190&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_ahx_mod.&#58;
../common/songinfo.c&#58;215&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;222&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;224&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58; In function .process_ptk_mod.&#58;
../common/songinfo.c&#58;239&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;261&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_digi_mod.&#58;
../common/songinfo.c&#58;287&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58;300&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
../common/songinfo.c&#58; In function .process_custom.&#58;
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;342&#58; warning&#58; pointer targets in passing argument 1 of .strncmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strlen. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .__builtin_strcmp. differ in signedness
../common/songinfo.c&#58;343&#58; warning&#58; pointer targets in passing argument 1 of .strncmp. differ in signedness
../common/songinfo.c&#58;348&#58; warning&#58; pointer targets in assignment differ in signedness
../common/songinfo.c&#58;377&#58; warning&#58; pointer targets in assignment differ in signedness
../common/songinfo.c&#58; In function .process_dm2_mod.&#58;
../common/songinfo.c&#58;417&#58; warning&#58; pointer targets in passing argument 1 of .string_checker. differ in signedness
[/code:1:ad156b4de2]

---

From: shd
Date: Fri Jun 30 14:03:24 2006

To: UADE-Developer-discussion
[quote:49e769c8fe="Melkor"]This isn't really a bug but I'm sure the UADE team will fix these small warnings for the beauty of clean code :-)
[/quote:49e769c8fe]

gcc4 is crying wolf :( I hate warnings too. Uade compiles without warnings on my gcc3.

[quote:49e769c8fe]As I was packaging uade-cvs for Ubuntu Dapper, I noticed these warnings when compiling.[/quote:49e769c8fe]

Good that you care about these things. I'm just not sure if putting char * sign casts is a good thing. It would remove the warnings, but it would also create potential type problems for the future and make the code less readable. Maybe we should put a flag to remove signedness warnings; preferably just for char * case, but I don't know gcc warning flags well. Want to investigate?

---

From: Melkor
Date: Fri Jun 30 15:56:04 2006

To: UADE-Developer-discussion
[quote:8bb25914ed="shd"]gcc4 is crying wolf :( I hate warnings too. Uade compiles without warnings on my gcc3[/quote:8bb25914ed]

GCC4 is very picky about code and I like that ! SAS/C on the Amiga, 11 years ago, learned me to code cleanly as I would not accept a single warning on a compiled project.

[quote:8bb25914ed="shd"]Good that you care about these things. I'm just not sure if putting char * sign casts is a good thing. It would remove the warnings, but it would also create potential type problems for the future and make the code less readable. Maybe we should put a flag to remove signedness warnings; preferably just for char * case, but I don't know gcc warning flags well. Want to investigate?[/quote:8bb25914ed]

I'm very oldschool fashioned and tend to love only clean things. I'm a bit maniac about that and I think I'll never change. All code must be clean, as a design point of view as well as implementation point of view. As of the design, errors are permitted, one always improve in life. As of implementation, no error is permitted, I hate bad code (non verified error conditions, assumptions, etc...) and I fight against it.

UADE is a good example of &quot;compile without warnings&quot;, that's why I posted this thread to fix the issue. As of the issue itself, I haven't looked at the code but if GCC4 complains about signedness, this probably means that there's a situation where a &quot;char *&quot; is put where a &quot;unsigned char *&quot; (or the other way round) is excepted. In this case, there's already an issue because they dont have the same range of action. Casting does not bring miracles but at least, on the incriminated code, GCC4 makes sure that the called function gets the arguments with a correct range of use.

Maybe I'm totally wrong as I don't have the insight you have in UADE but in all cases, a cubic object does not fit in a round hole :-)

---

From: shd
Date: Fri Jun 30 16:40:15 2006

To: UADE-Developer-discussion
[quote:ead72ddb3c="Melkor"]GCC4 makes sure that the called function gets the arguments with a correct range of use.
[/quote:ead72ddb3c]

I definitely agree type-safetiness is very important. Checkout the latest CVS version and see what it warns now..

---

From: Melkor
Date: Sun Jul 2 16:39:11 2006

Hi SHD,

I've checked out 20060702 and packaged it (but didn't commited it to public repository) and I still have a small warning (plugin.c). Here's the GCC's ouput:

[code:1:bca83f02ae]make&#91;2&#93;&#58; Entering directory `/opt/uade-cvs-2.02.20060702/src/frontends/xmms'
gcc -Wall -O2 -fPIC -shared -g -I/usr/include/xmms -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include  -I../common -I../../include -c plugin.c
plugin.c&#58; In function ‘play_loop’&#58;
plugin.c&#58;564&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;565&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;570&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;571&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;581&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;582&#58; warning&#58; pointer targets in passing argument 2 of ‘strlcpy’ differ in signedness
plugin.c&#58;601&#58; warning&#58; pointer targets in assignment differ in signedness[/code:1:bca83f02ae]

---

From: Enverex
Date: Thu Jul 20 16:03:12 2006

To: UADE-Developer-discussion
Melkor, did you manage to do this in the end? I couldn't manage to make a package of 2.02 stable because the makefile isn't sane (it tries to write files outside of $prefix (you may want to fix that guys) so pbuilder would spaz out with access violations.

---

From: shd
Date: Thu Jul 20 16:06:41 2006

To: UADE-Developer-discussion
[quote:9083c2c7fa="Enverex"]Melkor, did you manage to do this in the end? I couldn't manage to make a package of 2.02 stable because the makefile isn't sane (it tries to write files outside of $prefix (you may want to fix that guys) so pbuilder would spaz out with access violations.[/quote:9083c2c7fa]

Did you use --package-prefix?

---

From: shd
Date: Thu Jul 20 16:12:25 2006

To: UADE-Developer-discussion
[quote:b2f1e71519="shd"][quote:b2f1e71519="Enverex"]Melkor, did you manage to do this in the end? I couldn't manage to make a package of 2.02 stable because the makefile isn't sane (it tries to write files outside of $prefix (you may want to fix that guys) so pbuilder would spaz out with access violations.[/quote:b2f1e71519]

Did you use --package-prefix?[/quote:b2f1e71519]

Just a note, sometimes it is the intended behavior that it writes outside $prefix. For example, if prefix=/usr/local and an XMMS plugin is compiled and XMMS plugins are located in /usr/lib/xmms/Input/. Using package-prefix solves the packaging problem:

./configure --prefix=/usr --package-prefix=/tmp/mytree

Then the software is build so that it is runnable under /usr, but make install will copy files to /tmp/mytree/usr/.

Also, you shouldn't package 2.02. Latest CVS version is much better.

---

From: Melkor
Date: Thu Aug 10 10:18:53 2006

Sorry for not being present for a long time... Life you know.

uade-cvs is present in my repository for a long time now and works as expected of course.

This week will be a lot busy and the WE too... After that, I'll manage to see if there are a new CVS checkout and I'll package it but for now, I have few minutes to post here.

See you soon hopefully :-)