summaryrefslogtreecommitdiffstats
path: root/generic/tclTest.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2009-12-16 23:25:59 (GMT)
committernijtmans <nijtmans>2009-12-16 23:25:59 (GMT)
commitc09d5284e91311929d7e92c73492076e8a05cd36 (patch)
treeb7038bbc46d46d90860a433594776df4f31d744e /generic/tclTest.c
parentcf4896697457a54ad804eebeb31b63e27e41cb6c (diff)
downloadtcl-c09d5284e91311929d7e92c73492076e8a05cd36.zip
tcl-c09d5284e91311929d7e92c73492076e8a05cd36.tar.gz
tcl-c09d5284e91311929d7e92c73492076e8a05cd36.tar.bz2
Fix gcc warning: ignoring return value of ‘write’,
declared with attribute warn_unused_result CONSTify functions TclpGetUserHome and TclSetPreInitScript (TIP #27)
Diffstat (limited to 'generic/tclTest.c')
-rw-r--r--generic/tclTest.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/generic/tclTest.c b/generic/tclTest.c
index 812a610..192e7e2 100644
--- a/generic/tclTest.c
+++ b/generic/tclTest.c
@@ -14,7 +14,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclTest.c,v 1.142 2009/12/12 19:57:26 dkf Exp $
+ * RCS: @(#) $Id: tclTest.c,v 1.143 2009/12/16 23:26:01 nijtmans Exp $
*/
#undef STATIC_BUILD
@@ -2222,9 +2222,13 @@ ExitProcOdd(
ClientData clientData) /* Integer value to print. */
{
char buf[16 + TCL_INTEGER_SPACE];
+ size_t len;
sprintf(buf, "odd %d\n", PTR2INT(clientData));
- (void)write(1, buf, strlen(buf));
+ len = strlen(buf);
+ if (len != (size_t) write(1, buf, len)) {
+ Tcl_Panic("ExitProcOdd: unable to write to stdout");
+ }
}
static void
@@ -2232,9 +2236,13 @@ ExitProcEven(
ClientData clientData) /* Integer value to print. */
{
char buf[16 + TCL_INTEGER_SPACE];
+ size_t len;
sprintf(buf, "even %d\n", PTR2INT(clientData));
- (void)write(1, buf, strlen(buf));
+ len = strlen(buf);
+ if (len != (size_t) write(1, buf, len)) {
+ Tcl_Panic("ExitProcEven: unable to write to stdout");
+ }
}
/*