News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

a couple more gcc 4.4.3 compilation warnings

Started by yobbobandana, June 23, 2010, 01:50:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yobbobandana

A couple unsigned vs signed integer comparison warnings popped back in so I made a quick patch.
This assumes that a negative value for factory_worker_minimum_towns, factory_worker_maximum_towns, factory_worker_radius should mean no limit.

I also addressed the two "unused parameter" warnings.

All that is left after this is two warnings about "casting away constness", but in these cases that is exactly why the cast was used, so fixing them is a little less straightforward.

prissi

Well MSVC gives still 50+ legit warnings, GCC 2.95 still another 15 on haiku, and even MinGW GCC is not silent yet. I think silent is very much system and architecture dependent. But as long as it fixes errors ...

yobbobandana

Sadly I don't have any test setup other than gcc 4.4.3 on ubuntu 64-bit.

These warnings are certainly very minor. But it is so close to warning-free on this setup that I feel addressing them is worthwhile.

I would actually be happy to try to fix the warnings for other setups given a list of them, but of course couldn't test the fixes :).

neroden

Quote from: yobbobandana on June 23, 2010, 08:56:13 PM
Sadly I don't have any test setup other than gcc 4.4.3 on ubuntu 64-bit.

These warnings are certainly very minor. But it is so close to warning-free on this setup that I feel addressing them is worthwhile.

If you want a good project, turn on -Wconversion with gcc 4.4.3 and fix all of THOSE warnings.  :-)  Those all warn of serious potential computation errors....  I was starting in on it, but it's a huge job.

prissi

gcc does also emit meaningless warnings, and is generally are rather silent compiler. MSVC also emits valid warnings, about still 176 for a full translate, even when GCC was silent at a point. Also -Wconversion seems to report warnings for things not compiled due to preprocessor commands. So I would no define good from the number of warnings in GCC.

Václav

I found some warnings in compile.log of Windows versions - like I wrote it in else topic ([R3862 and up] Crash instead intro dialogue). I know only PHP but they seem be quite serious. For example, function cannot have two or more input parameters with the same name. Some principles are same in all languages. And also one missing file is called: WinSock2.h.

Last edit of my last post in that topic may be divorced from previous texts - due to this topic.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

prissi

Well, I do not get those. Aparently you did not install all needed files for the distribution (winsock2.h comes from the system. If this is missing, things got wrong in your compiler installation).

Václav

WinSock2.h may come from system - but I don't do own compilation. I only use files downloaded on nightlies page. So this cannot be fully on my side.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

prissi

This looks like MingW on the nightly site is out of order.

But since MinGW does not use IPv6 support, winsock2.h missing does not cause harm. I will have a look at the defines.

wernieman

On the nightly-Server I look that the Compiler Work. I don´t look if there could be some "warnings". Only Errors are important.

It is an cross-compiler. Every cross-compiler create some warnings about System-files. It is not easy that the compiler-System an the target-system is not the same, so it is a  fundamental problem of  cross-compiler.

With some work I could reduce some of the warnings, but ... sorry .... my private time is reduced and so .....

(and with every update I must do the same ..... :o( )
I hope you understand my English

Václav

In attachments is that missing file winsock2.h. So download it and I hope that next windows compilation would be running right again.

Chybami se člověk učí - ale někteří lidé jsou nepoučitelní

wernieman

I hope you understand my English

VS


My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

wernieman

*lol*

But .. could I use it ore not ... that is the quesion ;o)
I hope you understand my English

Dwachs

This header file is obviously not necessary to compile the executable. Otherwise the compiler would have failed with an error.
Parsley, sage, rosemary, and maggikraut.

prissi

Since MinGW uses IPv4 only (to run also on Win2k) I just submitted a change using old winsock in such cases.