[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Fix most warnings with gcc 4.4 on Linux
From: |
Bohdan R . Rau |
Subject: |
[PATCH] Fix most warnings with gcc 4.4 on Linux |
Date: |
Tue, 07 Sep 2010 16:18:23 +0200 |
On Tue, 7 Sep 2010 15:35:36 +0200, Boris Du?ek <boris.dusek at gmail.com>
wrote:
> Hello,
>
> when building the Ubuntu package for 0.7.1 Beta 2, I noticed lot of
> warnings in
> the build log from the PPA build server. Since having warnings is not
> good, I
> decided to fix them. I am posting a patch below that fixes most of them.
> Only 2
> warnings remain on amd64 Ubuntu 10.04 with gcc 4.4.3:
>
> src/server/history.c:38: warning: cast from pointer to integer of
> different size
> - I don't understand this one at all, the code seems correct. There is
no
> conversion from pointer to integer visible to me at all.
Yes, there is.
the "value" is declared as pointer (64-bit in your architecture), and is
casted to 32-bit int.
Try change "(int) value" into "(long) value".
As the history code should be rewritten (in fact the history doesn't work
at all) - it has no meaning now.
>
> src/c/api/libspeechd.c:263: warning: assignment discards qualifiers from
> pointer target type
> - I don't feel like I am able to correctly solve this one in little time
I can't compile the code now, but it looks like:
&(addr_in->sin_addr.s_addr)
which is not const, but inet_ntop definition required const.
Try (const void *) &(addr_in->sin_addr.s_addr)
but it's only cosmetics.
Remember: C is not C++ :)
ethanak
--
http://milena.polip.com/ - Pa pa, Ivonko!
[PATCH] Fix most warnings with gcc 4.4 on Linux, Christopher Brannon, 2010/09/07