GCC 4

All development related issues welcome

Moderator: Moderator Team

mily
Posts: 106
Joined: Tue Dec 21, 2004 4:35 pm
Contact:

GCC 4

Post by mily »

Does ReactOS compile under GCC 4.0.0 ??
TiKu
Posts: 157
Joined: Wed Jan 05, 2005 9:09 pm
Location: Unterföhring, Germany
Contact:

Post by TiKu »

Not completely. My last attempt failed, because some warnings were treated as errors. Unfortunately I can't remember the file that refused to compile.
oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

My last attempt failed too.

Post by oiaohm »

I disabled warning to errors.

There is a error in reactos source code in one section of code there is a depreacete methrod. Ie GCC 4.0.0 just spit the dummy and says I will not build this

Type changing is now forbind before the equals.
void * something;

(char *)something="string";

Works with Gcc 3 series but Gcc 4 and on will not build this.
So the new correct form is.
void * something;

something=(void *)"string";

Lets just say GCC is getting verry fussy on code construction.
2 series to 3 series made ; before } required. In version 2 you don't need the ; before }.

Also GCC 4 sniffs around for contruction faults far better than GCC 3.
TiKu
Posts: 157
Joined: Wed Jan 05, 2005 9:09 pm
Location: Unterföhring, Germany
Contact:

Post by TiKu »

Here's where my installation of GCC4 fails:
cc1.exe: warnings being treated as errors
ntoskrnl\io\disk.c: In function 'xHalQueryDriveLayout':
ntoskrnl\io\disk.c:195: warning: passing argument 4 of 'IoReadPartitionTable' from incompatible pointer type
ntoskrnl\io\disk.c: At top level:
ntoskrnl\io\disk.c:1532: error: conflicting types for 'IoReadPartitionTableEx'
w32api/include/ddk/winddk.h:7319: error: previous declaration of 'IoReadPartitionTableEx' was here
ntoskrnl\io\disk.c:1602: error: conflicting types for 'IoWritePartitionTableEx'
w32api/include/ddk/winddk.h:7848: error: previous declaration of 'IoWritePartitionTableEx' was here
ntoskrnl\io\disk.c:1615: error: conflicting types for 'IoReadPartitionTable'
w32api/include/ddk/win2k.h:67: error: previous declaration of 'IoReadPartitionTable' was here
ntoskrnl\io\disk.c: In function 'IoReadPartitionTable':
ntoskrnl\io\disk.c:1619: warning: passing argument 4 of 'HalDispatchTable.HalIoReadPartitionTable' from incompatible pointer type
ntoskrnl\io\disk.c: At top level:
ntoskrnl\io\disk.c:1642: error: conflicting types for 'IoWritePartitionTable'
w32api/include/ddk/win2k.h:86: error: previous declaration of 'IoWritePartitionTable' was here
ntoskrnl\io\disk.c: In function 'IoWritePartitionTable':
ntoskrnl\io\disk.c:1647: warning: passing argument 5 of 'HalDispatchTable.HalIoWritePartitionTable' from incompatible pointer type
mingw32-make: *** [obj-i386\ntoskrnl\io\disk.o] Error 1
I tried with revision 16524.
Dr. Fred
Developer
Posts: 607
Joined: Wed Dec 22, 2004 10:09 pm
Location: Amsterdam

Post by Dr. Fred »

TiKu wrote:Not completely. My last attempt failed, because some warnings were treated as errors. Unfortunately I can't remember the file that refused to compile.
If that was the only problem you can swich it off.
Where do you want ReactOS to go today ?
oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

TiKu You hit gold

Post by oiaohm »

ntoskrnl\io\disk.c has has a problem 2 of them.

Forgot I about this one. winddk.h and win2k.h that 3.3 does not care about but get what gcc 4.0 kick up a stink.

Its really nice and simple really nice and simple. Gcc 4.0 will compare your functions to declares in included .h files if the call function are different it will not build. Nice new feature of Gcc 4.0 if your include files are wrong you code will not build. So including Windows .h files willy nilly around reactos will break things because reactos functions will sometimes be different. Yep we are ment to have reactos .h files. Yes we will have to change some things around here.

Basicly this file need a fix. You have not got to the show buster yet.

Gcc 4.0 is a lot more fussy small things wrong it will not build.
Dr. Fred
Developer
Posts: 607
Joined: Wed Dec 22, 2004 10:09 pm
Location: Amsterdam

Re: TiKu You hit gold

Post by Dr. Fred »

oiaohm wrote: So including Windows .h files willy nilly around reactos will break things because reactos functions will sometimes be different. Yep we are ment to have reactos .h files. Yes we will have to change some things around here.
Windows calls are not different, at least they should not. And the windows.h we include is a reactos file.
Where do you want ReactOS to go today ?
oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

Ok You did not understand I ment.

Post by oiaohm »

void funct(char *a,char *b);

void funct(char *v1,char *v2) {
}

That will snap on gcc 4.0 as I say its fussy.

It will check that the declares the include match the function construction.

gcc 3 series will let this slide.

Basicly I hope gcc 4.0.1 will be a little less fussy about the code. I think is kinda taking it to the extream here.

Basicly the functions work exacty the same. The code is a little out.
steveh
Posts: 271
Joined: Sat Dec 18, 2004 10:02 pm

How check the version of installed gcc?

Post by steveh »

Can you please tell me which command or gcc optional parameter shows me the version info of the installed gcc?
TiKu
Posts: 157
Joined: Wed Jan 05, 2005 9:09 pm
Location: Unterföhring, Germany
Contact:

Post by TiKu »

gcc --version
sherpya
Posts: 25
Joined: Tue Dec 21, 2004 3:56 am
Location: Italy

Post by sherpya »

gcc version 4.0.1 cross compiler on a debian sid works fine, except
for explorer I cannot compile it, someone can tell me what's wrong? ;)

Code: Select all

subsys/system/explorer/utility/utility.h:753: error: expected class-name before '{' token
subsys/system/explorer/utility/utility.h:755: error: 'wstring' does not name a type
subsys/system/explorer/utility/utility.h:765: error: expected ',' or '...' before '&' token
subsys/system/explorer/utility/utility.h:765: error: ISO C++ forbids declaration of 'super' with no type
subsys/system/explorer/utility/utility.h:789: error: expected ',' or '...' before '&' token
subsys/system/explorer/utility/utility.h:789: error: ISO C++ forbids declaration of 'super' with no type
subsys/system/explorer/utility/utility.h: In constructor 'String::String(const TCHAR*)':
subsys/system/explorer/utility/utility.h:762: error: 'super' has not been declared
...
and also other, it seams that wstring class doesn't get defined
gcc 4.0.1
binutils 2.15.94-20050118.1-1
mingw runtime 3.7-1
oiaohm
Posts: 1322
Joined: Sun Dec 12, 2004 8:40 am

Post by oiaohm »

Think I know the problem.

Gcc build wrong for reactos. unicode support must be in the complier or you will stop.
GreatLord
Developer
Posts: 926
Joined: Tue Nov 30, 2004 10:26 am
Location: Sweden

Post by GreatLord »

We can build reactos with GCC 4.0 and GCC 3.x has some header problem. www.MinGW.org have take care of the header problem for 3.x for windows. that all. I know some of us devloper is using gcc 4.x
uriox
Posts: 24
Joined: Wed Oct 12, 2005 1:48 pm

Post by uriox »

What does GCC 4 bring by the way ?
cmoibenlepro
Posts: 483
Joined: Tue Nov 30, 2004 5:44 pm
Location: Canada

Post by cmoibenlepro »

uriox wrote:What does GCC 4 bring by the way ?
Speed.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 5 guests