From: Jarkko Hietaniemi Date: Mon, 18 Dec 2000 18:04:02 +0000 (+0000) Subject: Some compilers (e.g. HP-UX) can't switch on 64-bit integers. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e2962f6637a07657f5a31398e2f9be46bc90ef6d;p=p5sagit%2Fp5-mst-13.2.git Some compilers (e.g. HP-UX) can't switch on 64-bit integers. Fixes the bug 20001218.016. p4raw-id: //depot/perl@8183 --- diff --git a/regcomp.c b/regcomp.c index 69a9f91..f73f581 100644 --- a/regcomp.c +++ b/regcomp.c @@ -3224,7 +3224,9 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) value = UCHARAT(RExC_parse++); /* Some compilers cannot handle switching on 64-bit integer * values, therefore value cannot be an UV. Yes, this will - * be a problem later if we want switch on Unicode. --jhi */ + * be a problem later if we want switch on Unicode. + * A similar issue a little bit later when switching on + * namedclass. --jhi */ switch ((I32)value) { case 'w': namedclass = ANYOF_ALNUM; break; case 'W': namedclass = ANYOF_NALNUM; break; @@ -3335,7 +3337,11 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state) } if (!SIZE_ONLY) { - switch (namedclass) { + /* Possible truncation here but in some 64-bit environments + * the compiler gets heartburn about switch on 64-bit values. + * A similar issue a little earlier when switching on value. + * --jhi + switch ((I32)namedclass) { case ANYOF_ALNUM: if (LOC) ANYOF_CLASS_SET(ret, ANYOF_ALNUM);