diff --git a/lib/url.c b/lib/url.c
index 75e340064f301ad34dc43676c96c0ccc16a3c7e4..6d4ed94aa157235d51e8135ecc37c669845e7a1b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3373,9 +3373,9 @@ static CURLcode CreateConnection(struct SessionHandle *data,
 #ifdef HAVE_ALARM
     /* alarm() makes a signal get sent when the timeout fires off, and that
        will abort system calls */
-    prev_alarm = alarm(data->set.connecttimeout?
-                       data->set.connecttimeout:
-                       data->set.timeout);
+    prev_alarm = alarm((unsigned int) (data->set.connecttimeout?
+                                       data->set.connecttimeout:
+                                       data->set.timeout));
     /* We can expect the conn->created time to be "now", as that was just
        recently set in the beginning of this function and nothing slow
        has been done since then until now. */