>>> One thing I put under 0002 last time is really about 0001. With >>> ST_COMPARE_RUNTIME_POINTER and a pointer element type, the typedef >>> gives const Item ** but the sort passes Item **, so clang does not like it. >>> >>> >>> Writing ST_ELEMENT_TYPE const * in the typedef fixes it. >> I see. But seems like nothing in our code base triggers that. I leave it >> to John to make the call if we want to fix that or leave as is for now. > > I'm not quite sure I follow -- v3 removed the typedef we were talking > about earlier, and I understand Shihao to mean the warning was about > v1. Is there another issue? > One thing I put under 0002 last time is really about 0001
By that I understood that he accidentally put the following comment under patch 0002 but it was meant for patch 0001: > With ST_COMPARE_RUNTIME_POINTER the typedef > uses const ST_ELEMENT_TYPE *, which for Item * becomes const Item **, > so a comparator taking Item *const * warns. ST_ELEMENT_TYPE const * > fixes it. I thought this says that when ST_COMPARE_RUNTIME_POINTER is used, we can further improve const-correctness. But patch 0002 doesn't use ST_COMPARE_RUNTIME_POINTER, so this would be a separate improvement. But maybe I got it wrong, Shihao? -- David Geier
