Author barry
Recipients barry, pitrou, rhettinger, serhiy.storchaka, skrah, vstinner
Date 2017-09-05.23:02:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504652539.42.0.440860676914.issue31338@psf.upfronthosting.co.za>
In-reply-to
Content
So with this diff:

modified   Include/pymacro.h
@@ -95,4 +95,6 @@
 #define Py_UNUSED(name) _unused_ ## name
 #endif
 
+#define Py_UNREACHABLE() abort()
+
 #endif /* Py_PYMACRO_H */
modified   Python/compile.c
@@ -1350,8 +1350,7 @@ get_const_value(expr_ty e)
     case NameConstant_kind:
         return e->v.NameConstant.value;
     default:
-        assert(!is_const(e));
-        return NULL;
+        Py_UNREACHABLE();
     }
 }
 

Neither gcc (macOS, Ubuntu), nor clang (Ubuntu) complain.
History
Date User Action Args
2017-09-05 23:02:19barrysetrecipients: + barry, rhettinger, pitrou, vstinner, skrah, serhiy.storchaka
2017-09-05 23:02:19barrysetmessageid: <1504652539.42.0.440860676914.issue31338@psf.upfronthosting.co.za>
2017-09-05 23:02:19barrylinkissue31338 messages
2017-09-05 23:02:19barrycreate