Re: [patch] gcc4 fixes

2005-06-02 Thread Gerrit P. Haase

Brian Dessent wrote:


Christopher Faylor wrote:



While this might help to avoid... something, I'm seriously wondering
what's wrong with this expression.  Why does each new version of gcc
add new incompatibilities?


Well, it might actually be a gcc bug.



Here I admit to using a snapshot verion of gcc and not the 4.0 release,
primarily because I had read of bug reports e.g. KDE blacklisting 4.0
entirely in their build scripts due to compiler problems.  So who knows,
maybe I should try with a release build.

$ g++-4 -v
Using built-in specs.
Target: i686-pc-cygwin
Configured with: ../gcc-4.1-20050501/configure --verbose
--prefix=/usr/local --exec-prefix=/usr/local --sysconfdir=/etc
--libdir=/usr/local/lib --libexecdir=/usr/local/lib
--mandir=/usr/local/man --infodir=/usr/local/info --program-suffix=-4
--enable-languages=c,c++ --disable-nls --without-included-gettext
--with-system-zlib --enable-interpreter --enable-threads=posix
--enable-sjlj-exceptions --disable-version-specific-runtime-libs
--disable-win32-registry
Thread model: posix
gcc version 4.1.0 20050501 (experimental)


I want to switch using --disable-sjlj-exceptions with gcc-4.x, could you 
try to build with this instead of --enabl-sjlj?



Gerrit
--
=^..^=


[patch] gcc4 fixes

2005-05-17 Thread Brian Dessent

This is just a trivial change of argument to execl() testcases, which
supresses the warning 'missing sentinel in function call' in gcc4 that
causes the tests to fail.

winsup/testsuite
2005-05-17  Brian Dessent  [EMAIL PROTECTED]

* winsup.api/signal-into-win32-api.c (main): Use 'NULL' instead
of '0' in argument list to avoid compiler warning with gcc4.
* winsup.api/ltp/execle01.c (main): Ditto.
* winsup.api/ltp/execlp01.c (main): Ditto.
* winsup.api/ltp/fcntl07.c (do_exec): Ditto.
* winsup.api/ltp/fcntl07B.c (do_exec): Ditto.

This fixes the problem of mmap() not working with gcc4.

winsup/cygwin
2005-05-17  Brian Dessent  [EMAIL PROTECTED]

* mmap.cc (mmap64): Move 'granularity' into file scope so that
it will be initialized.Index: winsup.api/signal-into-win32-api.c
===
RCS file: /cvs/src/src/winsup/testsuite/winsup.api/signal-into-win32-api.c,v
retrieving revision 1.3
diff -u -p -r1.3 signal-into-win32-api.c
--- winsup.api/signal-into-win32-api.c  23 Jan 2003 21:21:28 -  1.3
+++ winsup.api/signal-into-win32-api.c  17 May 2005 20:12:57 -
@@ -37,7 +37,7 @@ main (int argc, char** argv)
   return 2;
 }
   else if (pid == 0)
-execl ( argv[0], argv[0], child, 0 );
+execl ( argv[0], argv[0], child, (char *)NULL );
   else
 {
   sleep_stage = 0;
Index: winsup.api/ltp/execle01.c
===
RCS file: /cvs/src/src/winsup/testsuite/winsup.api/ltp/execle01.c,v
retrieving revision 1.3
diff -u -p -r1.3 execle01.c
--- winsup.api/ltp/execle01.c   24 Jan 2003 01:09:39 -  1.3
+++ winsup.api/ltp/execle01.c   17 May 2005 20:12:57 -
@@ -172,7 +172,7 @@ main(int ac, char **av)
 */
switch(pid=fork()) {
case 0: /* CHILD - Call execle(2) */
-   execle(test, test, 0, environ);
+   execle(test, test, (char *)NULL, environ);
/* should not get here!! if we do, the parent will fail the Test 
Case */
exit(errno);
case -1:/* ERROR!!! exit now!!*/
Index: winsup.api/ltp/execlp01.c
===
RCS file: /cvs/src/src/winsup/testsuite/winsup.api/ltp/execlp01.c,v
retrieving revision 1.3
diff -u -p -r1.3 execlp01.c
--- winsup.api/ltp/execlp01.c   24 Jan 2003 01:09:39 -  1.3
+++ winsup.api/ltp/execlp01.c   17 May 2005 20:12:57 -
@@ -171,7 +171,7 @@ main(int ac, char **av)
 */
switch(pid=fork()) {
case 0: /* CHILD - Call execlp(2) */
-   execlp(/usr/bin/test, /usr/bin/test, 0);
+   execlp(/usr/bin/test, /usr/bin/test, (char *)NULL);
/* should not get here!! if we do, the parent will fail the Test 
Case */
exit(errno);
case -1:/* ERROR!!! exit now!!*/
Index: winsup.api/ltp/fcntl07.c
===
RCS file: /cvs/src/src/winsup/testsuite/winsup.api/ltp/fcntl07.c,v
retrieving revision 1.3
diff -u -p -r1.3 fcntl07.c
--- winsup.api/ltp/fcntl07.c24 Jan 2003 01:09:39 -  1.3
+++ winsup.api/ltp/fcntl07.c17 May 2005 20:12:57 -
@@ -375,7 +375,7 @@ do_exec(const char *prog, int fd, const 
 case -1:
return(-1);
 case 0:/* child */
-   execlp(prog, openck, -T, pidname, 0);
+   execlp(prog, openck, -T, pidname, (char *)NULL);
 
/* the ONLY reason to do this is to get the errno printed out */
fprintf(stderr, exec(%s, %s, -T, %s) failed.  Errno %s [%d]\n,
Index: winsup.api/ltp/fcntl07B.c
===
RCS file: /cvs/src/src/winsup/testsuite/winsup.api/ltp/fcntl07B.c,v
retrieving revision 1.3
diff -u -p -r1.3 fcntl07B.c
--- winsup.api/ltp/fcntl07B.c   24 Jan 2003 01:09:39 -  1.3
+++ winsup.api/ltp/fcntl07B.c   17 May 2005 20:12:57 -
@@ -374,7 +374,7 @@ do_exec(const char *prog, int fd, const 
 case -1:
return(-1);
 case 0:/* child */
-   execlp(prog, openck, -T, pidname, 0);
+   execlp(prog, openck, -T, pidname, (char *)NULL);
 
/* the ONLY reason to do this is to get the errno printed out */
fprintf(stderr, exec(%s, %s, -T, %s) failed.  Errno %s [%d]\n,


Index: mmap.cc
===
RCS file: /cvs/src/src/winsup/cygwin/mmap.cc,v
retrieving revision 1.109
diff -u -r1.109 mmap.cc
--- mmap.cc 2 May 2005 03:50:07 -   1.109
+++ mmap.cc 17 May 2005 22:40:14 -
@@ -500,14 +500,14 @@
 }
 }
 
+static DWORD granularity = getshmlba ();
+
 extern C void *
 mmap64 (void *addr, size_t len, int prot, int flags, int fd, _off64_t off)
 {
   syscall_printf (addr %x, len %u, prot %x, flags %x, fd %d, off %D,
  addr, len, prot, 

Re: [patch] gcc4 fixes

2005-05-17 Thread Brian Dessent
Christopher Faylor wrote:

 Go ahead and check these in but please use GNU formatting conventions,
 i.e., it's (char *) NULL, not (char *)NULL.  Actually, isn't just NULL
 sufficient?

I must have had C++ on the mind, thinking that the cast was necessary.

 Sorry but no.  This is a workaround.  We need to fix the actual problem.

Certainly.  I fully admit I have no real idea what the 'actual' problem
is yet.

Brian


Re: [patch] gcc4 fixes

2005-05-17 Thread Christopher Faylor
On Tue, May 17, 2005 at 06:15:08PM -0700, Brian Dessent wrote:
Christopher Faylor wrote:

 Go ahead and check these in but please use GNU formatting conventions,
 i.e., it's (char *) NULL, not (char *)NULL.  Actually, isn't just NULL
 sufficient?

I must have had C++ on the mind, thinking that the cast was necessary.

 Sorry but no.  This is a workaround.  We need to fix the actual problem.

Certainly.  I fully admit I have no real idea what the 'actual' problem
is yet.

I don't either, obviously.  Nice job tracking it down, regardless.

cgf