summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorrmax <rmax>2004-03-18 18:54:58 (GMT)
committerrmax <rmax>2004-03-18 18:54:58 (GMT)
commit395490646bbfb29fcab6b1b1b8a5e07a4df44a61 (patch)
tree9d537d73661574c4bab5dc78f841b3584cc72c05 /unix
parent767d68ec6d958a72ef767196d7efbd8d9b9f387d (diff)
downloadtcl-395490646bbfb29fcab6b1b1b8a5e07a4df44a61.zip
tcl-395490646bbfb29fcab6b1b1b8a5e07a4df44a61.tar.gz
tcl-395490646bbfb29fcab6b1b1b8a5e07a4df44a61.tar.bz2
* generic/tclNamesp.c: Added temporary pointer variables to work
* generic/tclStubLib.c: around warnings related to * unix/tclUnixChan.c: strict aliasing with GCC 3.3.
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixChan.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index 70a9712..4403ced 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixChan.c,v 1.46 2004/02/25 14:50:41 dkf Exp $
+ * RCS: @(#) $Id: tclUnixChan.c,v 1.47 2004/03/18 18:55:44 rmax Exp $
*/
#include "tclInt.h" /* Internal definitions for Tcl. */
@@ -3165,6 +3165,7 @@ TclUnixWaitForFile(fd, mask, timeout)
struct timeval blockTime, *timeoutPtr;
int index, bit, numFound, result = 0;
fd_mask readyMasks[3*MASK_SIZE];
+ fd_mask *maskp[3];
/* This array reflects the readable/writable
* conditions that were found to exist by the
* last call to select. */
@@ -3239,9 +3240,13 @@ TclUnixWaitForFile(fd, mask, timeout)
* Wait for the event or a timeout.
*/
- numFound = select(fd+1, (SELECT_MASK *) &readyMasks[0],
- (SELECT_MASK *) &readyMasks[MASK_SIZE],
- (SELECT_MASK *) &readyMasks[2*MASK_SIZE], timeoutPtr);
+ /* This is needed to satisfy GCC 3.3's strict aliasing rules */
+ maskp[0] = &readyMasks[0];
+ maskp[1] = &readyMasks[MASK_SIZE];
+ maskp[2] = &readyMasks[2*MASK_SIZE];
+ numFound = select(fd+1, (SELECT_MASK *) maskp[0],
+ (SELECT_MASK *) maskp[1],
+ (SELECT_MASK *) maskp[2], timeoutPtr);
if (numFound == 1) {
if (readyMasks[index] & bit) {
result |= TCL_READABLE;