From: Victor Stinner Date: Mon, 5 Dec 2016 16:55:36 +0000 (+0100) Subject: Issue #28152: Fix -Wunreachable-code warning on clang X-Git-Tag: v3.7.0a1~1842 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44d9bea1b823ed1ac25a78bb350b03848e59ac80;p=python Issue #28152: Fix -Wunreachable-code warning on clang Replace C if() with precompiler #if to fix a warning on dead code when using clang. --- diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 59046aaae4..950e4f4a28 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -998,13 +998,13 @@ read_directory(PyObject *archive) goto file_error; } name[name_size] = '\0'; /* Add terminating null byte */ - if (SEP != '/') { - for (i = 0; i < name_size; i++) { - if (name[i] == '/') { - name[i] = SEP; - } +#if SEP != '/' + for (i = 0; i < name_size; i++) { + if (name[i] == '/') { + name[i] = SEP; } } +#endif /* Skip the rest of the header. * On Windows, calling fseek to skip over the fields we don't use is * slower than reading the data because fseek flushes stdio's