This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Added several missing PERL_UNUSED_RESULT()
authorBrian Fraser <fraserbn@gmail.com>
Fri, 30 May 2014 23:28:18 +0000 (01:28 +0200)
committerBrian Fraser <fraserbn@gmail.com>
Thu, 12 Jun 2014 22:00:32 +0000 (00:00 +0200)
malloc.c
perl.h
util.c

index a6fb4e7..a99663e 100644 (file)
--- a/malloc.c
+++ b/malloc.c
@@ -1065,7 +1065,7 @@ emergency_sbrk(MEM_SIZE size)
 #endif /* defined PERL_EMERGENCY_SBRK */
 
 /* Don't use PerlIO buffered writes as they allocate memory. */
 #endif /* defined PERL_EMERGENCY_SBRK */
 
 /* Don't use PerlIO buffered writes as they allocate memory. */
-#define MYMALLOC_WRITE2STDERR(s) PerlLIO_write(PerlIO_fileno(PerlIO_stderr()),s,strlen(s))
+#define MYMALLOC_WRITE2STDERR(s) PERL_UNUSED_RESULT(PerlLIO_write(PerlIO_fileno(PerlIO_stderr()),s,strlen(s)))
 
 #ifdef DEBUGGING
 #undef ASSERT
 
 #ifdef DEBUGGING
 #undef ASSERT
diff --git a/perl.h b/perl.h
index 7b40126..3fa7db5 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -921,7 +921,7 @@ EXTERN_C int usleep(unsigned int);
 #  define CHECK_MALLOC_TAINT(newval)                           \
        CHECK_MALLOC_TOO_LATE_FOR_(                             \
                if (newval) {                                   \
 #  define CHECK_MALLOC_TAINT(newval)                           \
        CHECK_MALLOC_TOO_LATE_FOR_(                             \
                if (newval) {                                   \
-                 panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n");\
+                 PERL_UNUSED_RESULT(panic_write2("panic: tainting with $ENV{PERL_MALLOC_OPT}\n"));\
                  exit(1); })
 #  define MALLOC_CHECK_TAINT(argc,argv,env)    STMT_START {    \
        if (doing_taint(argc,argv,env)) {                       \
                  exit(1); })
 #  define MALLOC_CHECK_TAINT(argc,argv,env)    STMT_START {    \
        if (doing_taint(argc,argv,env)) {                       \
diff --git a/util.c b/util.c
index 3fa7991..ea13ff3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -4767,7 +4767,7 @@ S_mem_log_common(enum mem_log_type mlt, const UV n,
            if (strchr(pmlenv, 't')) {
                len = my_snprintf(buf, sizeof(buf),
                                MEM_LOG_TIME_FMT, MEM_LOG_TIME_ARG);
            if (strchr(pmlenv, 't')) {
                len = my_snprintf(buf, sizeof(buf),
                                MEM_LOG_TIME_FMT, MEM_LOG_TIME_ARG);
-               PerlLIO_write(fd, buf, len);
+               PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len));
            }
            switch (mlt) {
            case MLT_ALLOC:
            }
            switch (mlt) {
            case MLT_ALLOC:
@@ -4802,7 +4802,7 @@ S_mem_log_common(enum mem_log_type mlt, const UV n,
            default:
                len = 0;
            }
            default:
                len = 0;
            }
-           PerlLIO_write(fd, buf, len);
+           PERL_UNUSED_RESULT(PerlLIO_write(fd, buf, len));
        }
     }
 }
        }
     }
 }