How undefined are __builtin_ctz(0) or __builtin_clz(0)?
问题 Background For a long time, gcc has been providing a number of builtin bit-twiddling functions, in particular the number of trailing and leading 0-bits (also for long unsigned and long long unsigned , which have suffixes l and ll ): — Built-in Function: int __builtin_clz (unsigned int x) Returns the number of leading 0-bits in x , starting at the most significant bit position. If x is 0, the result is undefined. — Built-in Function: int __builtin_ctz (unsigned int x) Returns the number of