|
2001-10-17
| ||
| 04:12 | • Closed ticket [446622ffff]: gcc warnings on FreeBSD 2.x plus 7 other changes artifact: 4e4c565ac8 user: hobbs | |
|
2001-08-07
| ||
| 06:38 | • Ticket [446622ffff]: 1 change artifact: a8342158c9 user: hobbs | |
|
2001-08-01
| ||
| 00:41 | • New ticket [446622ffff]. artifact: 7da8611520 user: lloydlim | |
gcc warnings on FreeBSD 2.x
Closed / Fixed446622ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-08-01 00:41:14
The following compiler warnings appear on FreeBSD 2.2.x
with gcc 2.7.2.1:
./../unix/tclLoadAout.c: In function `TclpLoadFile':
./../unix/tclLoadAout.c:227: warning: implicit
declaration of function `read'
./../unix/tclLoadAout.c:284: warning: implicit
declaration of function `unlink'
./../unix/tclLoadAout.c:290: warning: implicit
declaration of function `close'
./../unix/tclLoadAout.c: In function `FindLibraries':
./../unix/tclLoadAout.c:334: warning: `c' might be used
uninitialized in this function
./../unix/tclLoadAout.c: In function
`TclGuessPackageName':
./../unix/tclLoadAout.c:475: warning: suggest
parentheses around assignment used as truth value
./../unix/tclLoadAout.c:473: warning: unused variable
`dstOff'
./../unix/tclLoadAout.c:473: warning: unused variable
`srcOff'
After including unistd.h, the following additional
problems appear:
./../unix/tclLoadAout.c:77: conflicting types for `brk'
/usr/include/unistd.h:107: previous declaration of
`brk'
./../unix/tclLoadAout.c:78: conflicting types for
`sbrk'
/usr/include/unistd.h:155: previous declaration of
`sbrk'
*** Error code 1
Here are the patches to get it to compile cleanly:
--- tcl.m4.old Tue Jul 31 14:36:29 2001
+++ tcl.m4 Tue Jul 31 16:43:08 2001
@@ -1208,6 +1208,14 @@
fi
fi
fi
+
+ AC_MSG_CHECKING(for brk declaration in
unistd.h)
+ AC_EGREP_HEADER(brk, unistd.h, [
+ AC_DEFINE(BRK_DECLARED)
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ ])
fi
# Step 5: disable dynamic loading if requested via
a command-line switch.
--- tclLoadAout.c.old Tue Jul 31 14:36:49 2001
+++ tclLoadAout.c Tue Jul 31 16:44:17 2001
@@ -19,6 +19,11 @@
#include "tclInt.h"
#include <fcntl.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# include "../compat/unistd.h"
+#endif
#ifdef HAVE_EXEC_AOUT_H
# include <sys/exec_aout.h>
#endif
@@ -69,8 +74,10 @@
* Kernel calls that appear to be missing from the
system .h files:
*/
+#ifndef BRK_DECLARED
extern char * brk _ANSI_ARGS_((char *));
extern char * sbrk _ANSI_ARGS_((size_t));
+#endif
/*
* The static variable SymbolTableFile contains the
file name where the
@@ -331,7 +338,7 @@
Tcl_DString * buf; /* Buffer where
the -l an -L flags */
{
FILE * f; /* The load module */
- int c; /* Byte from the load
module */
+ int c = 0; /* Byte from the load
module */
char * p;
Tcl_DString ds;
CONST char *native;
@@ -470,9 +477,8 @@
* package name to this
if possible. */
{
char *p, *q, *r;
- int srcOff, dstOff;
- if (q = strrchr(fileName,'/')) {
+ if ((q = strrchr(fileName,'/'))) {
q++;
} else {
q = fileName;
hobbs Ticket [446622ffff]: 1 change
[History diff]2001-08-07 06:38:00
hobbsplain2001-10-17 04:12:10
Logged In: YES user_id=72656 fixed for 8.3.4 and 8.4a4. The tcl.m4 check was unnecessary as that is already done (the unistd.h could is used in tclUnixPort.h as well).
Log in (anonymous is fine) to add a comment.