Re: another -Wunsequenced topic

看板FB_current作者時間12年前 (2013/07/09 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/6 (看更多)
Well, this turned out to be a semi-false alarm. A week ago, for a short time, there was a bug in Clang. There is no undefined behavior in ptr = func(++ptr);, partially because a function call introduces a sequence point in C, but Clang did not respect this at that time. However, x = func1(++ptr) + func2(++ptr); is compiler-dependent. Additionally, if func() turns out to be a macro, rather than a native function, then undefined behavior (due to unsequencedness) occurs. According to the manpage for ntohl(): "On machines which have a byte order which is the same as the network order, routines are defined as null macros.". This can bite libstand on big-endian systems So in the end, Clang has accidentally pointed me to an irrelated bug, and induced some unnecessary code changes. lolz _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1HsuGpTb (FB_current)
文章代碼(AID): #1HsuGpTb (FB_current)