diff --git a/src/lib.rs b/src/lib.rs
index 57919c59f96dcf49b72c39777129a26dd7705507..2593e3ba6bc00e85cdeedbb1e16b39b8477dd8aa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -258,8 +258,10 @@ cfg_if! {
     if #[cfg(windows)] {
         mod windows;
         pub use windows::*;
-    } else {
+    } else if #[cfg(unix)] {
         mod unix;
         pub use unix::*;
+    } else {
+        // Unknown target_family
     }
 }
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index ec0fe7c111b43fbd6ebfdd82a539015dc05da811..e96f433f1864857cbe12ae95d8a5f537cc261a12 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -946,6 +946,6 @@ cfg_if! {
         mod b64;
         pub use self::b64::*;
     } else {
-        // unknown arch...
+        // Unknown target_arch
     }
 }
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 171889e561b56570be0ea34f87ec7f3ee10051d5..7d98ef4373e4f387a73448f71c71185e1dfeba9a 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -86,6 +86,6 @@ cfg_if! {
         mod x86_64;
         pub use self::x86_64::*;
     } else {
-        // ...
+        // Unknown target_arch
     }
 }
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 139edf717dc85f22ea6e8d740f701ca39dcbfa51..b633003aa592bdae2afb916b986ce9ce233bc287 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -350,6 +350,6 @@ cfg_if! {
         mod freebsdlike;
         pub use self::freebsdlike::*;
     } else {
-        // ...
+        // Unknown target_os
     }
 }
diff --git a/src/unix/bsd/openbsdlike/mod.rs b/src/unix/bsd/openbsdlike/mod.rs
index 1cd6eb816a6192820966e3808147015c2e9ac615..1a2bdffa8b5aa4b8a31ed6334827d96d8cc5b282 100644
--- a/src/unix/bsd/openbsdlike/mod.rs
+++ b/src/unix/bsd/openbsdlike/mod.rs
@@ -402,8 +402,10 @@ cfg_if! {
     } else if #[cfg(target_os = "netbsd")] {
         mod netbsd;
         pub use self::netbsd::*;
-    } else {
+    } else if #[cfg(target_os = "openbsd")] {
         mod openbsd;
         pub use self::openbsd::*;
+    } else {
+        // Unknown target_os
     }
 }
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 3ffb3b79cf9d205ec9e1c7471fe91e9bffdbd5c9..77b24f229f9a0fea7d4f579f445a56a6ae923459 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -733,6 +733,6 @@ cfg_if! {
         mod solaris;
         pub use self::solaris::*;
     } else {
-        // ...
+        // Unknown target_os
     }
 }
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index f039683a7e4cefdb53b1ffa15e06c14d0c3bce11..0a01bcc1c5d5de9b0312d51db7c36324bfbdcb45 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -657,6 +657,6 @@ cfg_if! {
         mod b64;
         pub use self::b64::*;
     } else {
-        // ...
+        // Unknown target_pointer_width
     }
 }
diff --git a/src/unix/notbsd/linux/musl/b32/mod.rs b/src/unix/notbsd/linux/musl/b32/mod.rs
index 668e8fc95c7ed4cc8bfdc5ae8c382ae105f65031..ad74e8816d17b7f4547cc40d011117b4fde5bf2d 100644
--- a/src/unix/notbsd/linux/musl/b32/mod.rs
+++ b/src/unix/notbsd/linux/musl/b32/mod.rs
@@ -38,5 +38,7 @@ cfg_if! {
     } else if #[cfg(any(target_arch = "asmjs"))] {
         mod asmjs;
         pub use self::asmjs::*;
-    } else { }
+    } else {
+        // Unknown target_arch
+    }
 }
diff --git a/src/unix/notbsd/linux/other/b32/mod.rs b/src/unix/notbsd/linux/other/b32/mod.rs
index 908fa40a566d4967d5b697124624faafaa04fc83..b39ff683f60e6a7626183017d21731882b043e22 100644
--- a/src/unix/notbsd/linux/other/b32/mod.rs
+++ b/src/unix/notbsd/linux/other/b32/mod.rs
@@ -90,6 +90,6 @@ cfg_if! {
         mod powerpc;
         pub use self::powerpc::*;
     } else {
-        // ...
+        // Unknown target_arch
     }
 }
diff --git a/src/unix/notbsd/linux/other/b64/mod.rs b/src/unix/notbsd/linux/other/b64/mod.rs
index 28d9e4d00f85f85668b8b2ce52b97d6d9c099909..663b09333cdf7cf32bcfb7135cfe214c44f3eeb7 100644
--- a/src/unix/notbsd/linux/other/b64/mod.rs
+++ b/src/unix/notbsd/linux/other/b64/mod.rs
@@ -25,8 +25,10 @@ cfg_if! {
     } else if #[cfg(any(target_arch = "powerpc64"))] {
         mod powerpc64;
         pub use self::powerpc64::*;
-    } else {
+    } else if #[cfg(any(target_arch = "x86_64"))] {
         mod x86_64;
         pub use self::x86_64::*;
+    } else {
+        // Unknown target_arch
     }
 }
diff --git a/src/unix/notbsd/linux/other/mod.rs b/src/unix/notbsd/linux/other/mod.rs
index 09d7e355c54b6758604fe6c3c9bf5c5af7d974ea..3ac57fe7e900eed10e26d2cb5dad0fb828dbfd9e 100644
--- a/src/unix/notbsd/linux/other/mod.rs
+++ b/src/unix/notbsd/linux/other/mod.rs
@@ -491,6 +491,6 @@ cfg_if! {
         mod b64;
         pub use self::b64::*;
     } else {
-        // ...
+        // Unknown target_arch
     }
 }
diff --git a/src/unix/notbsd/mod.rs b/src/unix/notbsd/mod.rs
index 6106438739c597a12e2aa343e50ff68ba35cec9f..7cdd63cea97f5a2edcfa0d149479d690e1858377 100644
--- a/src/unix/notbsd/mod.rs
+++ b/src/unix/notbsd/mod.rs
@@ -133,6 +133,7 @@ cfg_if! {
     } else if #[cfg(target_pointer_width = "64")] {
         const ULONG_SIZE: usize = 64;
     } else {
+        // Unknown target_pointer_width
     }
 }
 
@@ -680,6 +681,6 @@ cfg_if! {
         mod android;
         pub use self::android::*;
     } else {
-        // ...
+        // Unknown target_os
     }
 }
diff --git a/src/windows.rs b/src/windows.rs
index 3f7f160ff320b319579dae51839d76205179973d..21b6e13b747ec42145d3395b3fe21710078c3736 100644
--- a/src/windows.rs
+++ b/src/windows.rs
@@ -72,9 +72,11 @@ cfg_if! {
     if #[cfg(all(target_env = "gnu"))] {
         pub const L_tmpnam: ::c_uint = 14;
         pub const TMP_MAX: ::c_uint = 0x7fff;
-    } else {
+    } else if #[cfg(all(target_env = "msvc"))] {
         pub const L_tmpnam: ::c_uint = 260;
         pub const TMP_MAX: ::c_uint = 0x7fff_ffff;
+    } else {
+        // Unknown target_env
     }
 }