Message-Id: <199809071847.UAA25292@ieva06.lanet.lv> From: "Andris Pavenis" To: djgpp-workers AT delorie DOT com Date: Mon, 7 Sep 1998 20:51:20 +0300 MIME-Version: 1.0 Content-type: Multipart/Mixed; boundary=Message-Boundary-2590 Subject: Patch for building DJLSR with egcs-1.1 CC: dj AT delorie DOT com Precedence: bulk --Message-Boundary-2590 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Content-description: Mail message body Hi! I'm including patch I needed to build DJLSR with egcs-1.1a. Patch is against djlsr202-980726. Summary of changes: - many places: void foo ( const char * xx ); cast '(char * const *) &xx' generates message that cast discards const. I think gcc should generate such message. I changed source to use union to fool gcc - src/libemu/emu387.cc: Option -Wshadow causes message that static function fabs() shadows builtin one. I changed name of static function to fabs_() - src/libemu/emu387.cc: gcc required that procedure have explicitly declared type. Therefore I changed extern "C" _write (... to extern "C" int _write (... At least I didn't find any problems yet with libc.a I built using egcs-1.1 (relinked RHIDE, some my applications) Andris --Message-Boundary-2590 Content-type: text/plain; charset=US-ASCII Content-disposition: inline Content-description: Attachment information. The following section of this message contains a file attachment prepared for transmission using the Internet MIME message format. If you are using Pegasus Mail, or any another MIME-compliant system, you should be able to save it or view it from within your mailer. If you cannot, please ask your system administrator for assistance. ---- File information ----------- File: djlsr.diff Date: 7 Sep 1998, 20:18 Size: 7564 bytes. Type: Text --Message-Boundary-2590 Content-type: Application/Octet-stream; name="djlsr.diff"; type=Text Content-disposition: attachment; filename="djlsr.diff" diff -c3r src/libc/dos/process/spawnl.c d:src/libc/dos/process/spawnl.c *** src/libc/dos/process/spawnl.c Wed Jan 11 03:45:08 1995 --- d:src/libc/dos/process/spawnl.c Mon Sep 7 19:02:28 1998 *************** *** 6,10 **** int spawnl(int mode, const char *path, const char *argv0, ...) { ! return spawnve(mode, path, (char * const *)&argv0, environ); } --- 6,12 ---- int spawnl(int mode, const char *path, const char *argv0, ...) { ! union { const char * const * xc; char * const * x; } W; ! W.xc = &argv0; ! return spawnve(mode, path, W.x, environ); } diff -c3r src/libc/dos/process/spawnle.c d:src/libc/dos/process/spawnle.c *** src/libc/dos/process/spawnle.c Mon Dec 26 15:35:20 1994 --- d:src/libc/dos/process/spawnle.c Mon Sep 7 19:05:34 1998 *************** *** 5,10 **** int spawnle(int mode, const char *path, const char *argv0, ... /*, const char **envp */) { ! scan_ptr(); ! return spawnve(mode, path, (char * const *)&argv0, (char * const *)ptr); } --- 5,12 ---- int spawnle(int mode, const char *path, const char *argv0, ... /*, const char **envp */) { ! union { const char * const * xc; char * const * x; } W1, W2; ! scan_ptr(); ! W1.xc = &argv0; W2.xc = ptr; ! return spawnve(mode, path, W1.x, W2.x); } diff -c3r src/libc/dos/process/spawnlp.c d:src/libc/dos/process/spawnlp.c *** src/libc/dos/process/spawnlp.c Wed Jan 11 03:45:08 1995 --- d:src/libc/dos/process/spawnlp.c Mon Sep 7 19:27:08 1998 *************** *** 6,10 **** int spawnlp(int mode, const char *path, const char *argv0, ...) { ! return spawnvpe(mode, path, (char * const *)&argv0, (char * const *)environ); } --- 6,12 ---- int spawnlp(int mode, const char *path, const char *argv0, ...) { ! union { const char * const * xc; char * const * x; } W; ! W.xc = &argv0; ! return spawnvpe(mode, path, W.x, (char * const *)environ); } diff -c3r src/libc/dos/process/spawnlpe.c d:src/libc/dos/process/spawnlpe.c *** src/libc/dos/process/spawnlpe.c Mon Dec 26 15:35:20 1994 --- d:src/libc/dos/process/spawnlpe.c Mon Sep 7 19:28:52 1998 *************** *** 5,10 **** int spawnlpe(int mode, const char *path, const char *argv0, ... /*, const char **envp */) { scan_ptr(); ! return spawnvpe(mode, path, (char * const *)&argv0, (char * const *)ptr); } --- 5,12 ---- int spawnlpe(int mode, const char *path, const char *argv0, ... /*, const char **envp */) { + union { const char * const * xc; char * const * x; } W1, W2; scan_ptr(); ! W1.xc = &argv0; W2.xc = ptr; ! return spawnvpe(mode, path, W1.x, W2.x); } diff -c3r src/libc/pc_hw/co80/conio.c d:src/libc/pc_hw/co80/conio.c *** src/libc/pc_hw/co80/conio.c Sat Jul 25 19:01:44 1998 --- d:src/libc/pc_hw/co80/conio.c Mon Sep 7 19:36:14 1998 *************** *** 704,711 **** int cscanf(const char *fmt, ...) { return(_doscan_low(NULL, _scan_getche, _scan_ungetch, ! fmt, (void **)((&fmt)+1))); } int --- 704,713 ---- int cscanf(const char *fmt, ...) { + union { const char * const * xc; void ** x; } W; + W.xc = (&fmt) + 1; return(_doscan_low(NULL, _scan_getche, _scan_ungetch, ! fmt, W.x)); } int diff -c3r src/libc/posix/glob/glob.c d:src/libc/posix/glob/glob.c *** src/libc/posix/glob/glob.c Sun Jul 12 19:11:04 1998 --- d:src/libc/posix/glob/glob.c Mon Sep 7 19:41:44 1998 *************** *** 337,343 **** static int str_compare(const void *va, const void *vb) { ! return strcmp(*(char * const *)va, *(char * const *)vb); } int --- 337,343 ---- static int str_compare(const void *va, const void *vb) { ! return strcmp(*(const char * const *)va, *(const char * const *)vb); } int diff -c3r src/libc/posix/unistd/execl.c d:src/libc/posix/unistd/execl.c *** src/libc/posix/unistd/execl.c Sun Oct 8 21:21:32 1995 --- d:src/libc/posix/unistd/execl.c Mon Sep 7 18:57:18 1998 *************** *** 7,11 **** int execl(const char *path, const char *argv0, ...) { ! return spawnve(P_OVERLAY, path, (char *const*)&argv0, environ); } --- 7,13 ---- int execl(const char *path, const char *argv0, ...) { ! union { const char * const * xc; char * const * x; } W; ! W.xc = &argv0; ! return spawnve(P_OVERLAY, path, W.x, environ); } diff -c3r src/libc/posix/unistd/execle.c d:src/libc/posix/unistd/execle.c *** src/libc/posix/unistd/execle.c Mon Dec 26 15:35:30 1994 --- d:src/libc/posix/unistd/execle.c Mon Sep 7 18:59:44 1998 *************** *** 6,11 **** int execle(const char *path, const char *argv0, ... /*, const char **envp */) { scan_ptr(); ! return spawnve(P_OVERLAY, path, (char *const *)&argv0, (char *const *)ptr); } --- 6,13 ---- int execle(const char *path, const char *argv0, ... /*, const char **envp */) { + union { const char * const * xc; char * const * x; } W1, W2; scan_ptr(); ! W1.xc = &argv0; W2.xc = ptr; ! return spawnve(P_OVERLAY, path, W1.x, W2.x); } diff -c3r src/libc/posix/unistd/execlp.c d:src/libc/posix/unistd/execlp.c *** src/libc/posix/unistd/execlp.c Sun Oct 8 21:21:26 1995 --- d:src/libc/posix/unistd/execlp.c Mon Sep 7 19:47:34 1998 *************** *** 8,12 **** int execlp(const char *path, const char *argv0, ...) { ! return spawnvpe(P_OVERLAY, path, (char * const *)&argv0, environ); } --- 8,14 ---- int execlp(const char *path, const char *argv0, ...) { ! union { const char * const * xc; char * const * x; } W; ! W.xc = &argv0; ! return spawnvpe(P_OVERLAY, path, W.x, environ); } diff -c3r src/libc/posix/unistd/execlpe.c d:src/libc/posix/unistd/execlpe.c *** src/libc/posix/unistd/execlpe.c Mon Dec 26 15:35:30 1994 --- d:src/libc/posix/unistd/execlpe.c Mon Sep 7 19:48:34 1998 *************** *** 6,11 **** int execlpe(const char *path, const char *argv0, ... /*, const char **envp */) { scan_ptr(); ! return spawnvpe(P_OVERLAY, path, (char * const *)&argv0, (char * const *)ptr); } --- 6,13 ---- int execlpe(const char *path, const char *argv0, ... /*, const char **envp */) { + union { const char * const * xc; char * const * x; } W1, W2; scan_ptr(); ! W1.xc = &argv0; W2.xc = ptr; ! return spawnvpe(P_OVERLAY, path, W1.x, W2.x); } diff -c3r src/libemu/src/emu387.cc d:src/libemu/src/emu387.cc *** src/libemu/src/emu387.cc Sun Nov 2 19:57:14 1997 --- d:src/libemu/src/emu387.cc Mon Sep 7 19:56:50 1998 *************** *** 120,126 **** inline reg& st(int which=0) { return regs[(top+which)&7]; } ! extern "C" _write(int,void*,int); static inline int val_same(reg& a, reg& b) { --- 120,126 ---- inline reg& st(int which=0) { return regs[(top+which)&7]; } ! extern "C" int _write(int,void*,int); static inline int val_same(reg& a, reg& b) { *************** *** 1517,1523 **** status_word &= ~SW_C1; } ! static void fabs() { if (empty()) return; --- 1517,1523 ---- status_word &= ~SW_C1; } ! static void fabs_() { if (empty()) return; *************** *** 1591,1597 **** } static FUNC emu_14_table[] = { ! fchs, fabs, emu_bad, emu_bad, ftst, fxam, emu_bad, emu_bad }; static void emu_14() --- 1591,1597 ---- } static FUNC emu_14_table[] = { ! fchs, fabs_, emu_bad, emu_bad, ftst, fxam, emu_bad, emu_bad }; static void emu_14() --Message-Boundary-2590--