[Geany] [PATCH] Fixes for warnings and portability

Daniel Richard G. skunk at xxxxx
Fri Feb 22 18:27:29 UTC 2008


On Fri, 2008 Feb 22 08:19:44 -0600, Jeff Pohlmeyer wrote:
> 
> Thanks for the tip, Daniel - just for kicks I ran these flags on
> the GeanyLua plugin. ( Man, what a mess! :)

The first time is always the trickiest ^_^

> I managed to get everything cleaned up, with the exception of the
> -Wconversion flag. As far as I can tell, there is absolutely no way
> to use that flag with e.g. gtk_misc_set_alignment() without getting
> a warning.

Well, there it would just be a matter of casting the (presumably integer) 
second and third arguments to float. Though I'd agree that doing this sort 
of thing every time the warning arises is overkill.

What I normally do is filter the warnings, and address only the conversions 
that are a bit iffy (float -> int, signed -> unsigned, etc.)---making up 
for the lack of granularity in what -Wconversion reports.

> So I did some googling[1] and it seems that the -Wconversion flag
> is not intended for general use, it is only useful when converting
> K&R code to ANSI/ISO. Apparently this issue has been addressed
> in gcc-4.3 but I'm still using  4.2.1
> 
> Just thought I would pass that along before someone else throws
> a keyboard through their monitor :-)

Yeah, of the set of warnings I gave, that's the least compelling one. It's 
nice to use from the start with newly-written code, but in most other 
cases, it's not worth the effort to make the compiler shut up.


--Daniel


-- 
NAME   = Daniel Richard G.       ##  Remember, skunks       _\|/_  meef?
EMAIL1 = skunk at iskunk.org        ##  don't smell bad---    (/o|o\) /
EMAIL2 = skunk at alum.mit.edu      ##  it's the people who   < (^),>
WWW    = http://www.******.org/  ##  annoy them that do!    /   \
--
(****** = site not yet online)



More information about the Users mailing list