-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
Closed
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Use do-while(0)
construction to protect the expansion of ADJUST_INDICES
in:
cpython/Objects/unicodeobject.c
Lines 9318 to 9330 in d6d8707
#define ADJUST_INDICES(start, end, len) \ if (end > len) \ end = len; \ else if (end < 0) { \ end += len; \ if (end < 0) \ end = 0; \ } \ if (start < 0) { \ start += len; \ if (start < 0) \ start = 0; \ } cpython/Objects/bytes_methods.c
Lines 435 to 447 in 2cb84b1
#define ADJUST_INDICES(start, end, len) \ if (end > len) \ end = len; \ else if (end < 0) { \ end += len; \ if (end < 0) \ end = 0; \ } \ if (start < 0) { \ start += len; \ if (start < 0) \ start = 0; \ }
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement