Index: src/main/random.c
===================================================================
--- src/main/random.c	(revision 44677)
+++ src/main/random.c	(working copy)
@@ -81,6 +81,7 @@
     if (na < 1) {
 	for (i = 0; i < n; i++)
 	    REAL(x)[i] = NA_REAL;
+        warning(_("NAs produced"));
     }
     else {
 	PROTECT(a = coerceVector(CADR(args), REALSXP));
@@ -123,7 +124,7 @@
 
 #define RAND2(num,name) \
 	case num: \
-		random2(name, REAL(a), na, REAL(b), nb, REAL(x), n); \
+		naflag = random2(name, REAL(a), na, REAL(b), nb, REAL(x), n); \
 		break
 
 /* "do_random2" - random sampling from 2 parameter families. */
@@ -155,6 +156,7 @@
     if (na < 1 || nb < 1) {
 	for (i = 0; i < n; i++)
 	    REAL(x)[i] = NA_REAL;
+        warning(_("NAs produced"));
     }
     else {
 	PROTECT(a = coerceVector(CADR(args), REALSXP));
@@ -207,7 +209,7 @@
 
 #define RAND3(num,name) \
 	case num: \
-		random3(name, REAL(a), na, REAL(b), nb, REAL(c), nc, REAL(x), n); \
+		naflag = random3(name, REAL(a), na, REAL(b), nb, REAL(c), nc, REAL(x), n); \
 		break
 
 
@@ -244,6 +246,7 @@
     if (na < 1 || nb < 1 || nc < 1) {
 	for (i = 0; i < n; i++)
 	    REAL(x)[i] = NA_REAL;
+        warning(_("NAs produced"));
     }
     else {
 	PROTECT(a = coerceVector(a, REALSXP));
