Re: another -Wunsequenced topic
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"
討論串 (同標題文章)
完整討論串 (本文為第 4 之 6 篇):