You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, base64 stream stores EOF in a char variable, which may cause undefined behavior for ARM targets.
Details. std::istream.get() and getchar() have return type int, not char, because both may return EOF, which is commonly -1. Storing EOF in a char results in undefined behavior. The char type is usually signed on x86 systems but unsigned on ARM systems (see http://blog.cdleary.com/2012/11/arm-chars-are-unsigned-by-default/), so the undefined behavior will only be apparent when compiled on ARM.
Related: dmlc/xgboost#3976.
Currently, base64 stream stores EOF in a
char
variable, which may cause undefined behavior for ARM targets.Details.
std::istream.get()
andgetchar()
have return typeint
, notchar
, because both may return EOF, which is commonly -1. Storing EOF in achar
results in undefined behavior. Thechar
type is usually signed on x86 systems but unsigned on ARM systems (see http://blog.cdleary.com/2012/11/arm-chars-are-unsigned-by-default/), so the undefined behavior will only be apparent when compiled on ARM.Aside. AWS has recently begun offering ARM-backed EC2 instances.
The text was updated successfully, but these errors were encountered: