20 Sep
2014
20 Sep
'14
5:48 p.m.
On Sat, Sep 20, 2014 at 3:20 AM, TONGARI J
I guess something like below should work?
#include <iostream>
__attribute__((noinline)) bool is_upward_test(char* a) { char b[32]; return a < b; }
bool is_upward() { char a[32]; return is_upward_test(a); }
int main(int argc, char** argv) { std::cout << is_upward(); return 0; }
Doesn't the standard say pointer comparisons are only defined between pointers into the same container? Therefore wouldn't the above be UB?