aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2013-09-09 15:07:23 -0400
committerRuss Cox <rsc@golang.org>2013-09-09 15:07:23 -0400
commit7d734d9252febfd91cb0ff5fc54f11defc5f4daa (patch)
treeff3ade73bd586a219fc64d333da6623cc3c9526f /include
parent6252b41981a5e5566b727de14cda5aece4bee98f (diff)
downloadgo-7d734d9252febfd91cb0ff5fc54f11defc5f4daa.tar.xz
build: remove various uses of C undefined behavior
If you thought gcc -ansi -pedantic was pedantic, just wait until you meet clang -fsanitize=undefined. I think this addresses all the reported "errors", but we'll need another run to be sure. all.bash still passes. Update #5764 Dave, can you please try again? R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/13334049
Diffstat (limited to 'include')
-rw-r--r--include/bio.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/bio.h b/include/bio.h
index be4d8d80ee..5506c7c328 100644
--- a/include/bio.h
+++ b/include/bio.h
@@ -79,7 +79,7 @@ struct Biobuf
#define BGETLE2(bp)\
((bp)->icount<=-2?((bp)->icount+=2,((bp)->ebuf[(bp)->icount-2])|((bp)->ebuf[(bp)->icount-1]<<8)):Bgetle2((bp)))
#define BGETLE4(bp)\
- ((bp)->icount<=-4?((bp)->icount+=4,((bp)->ebuf[(bp)->icount-4])|((bp)->ebuf[(bp)->icount-3]<<8)|((bp)->ebuf[(bp)->icount-2]<<16)|((bp)->ebuf[(bp)->icount-1]<<24)):Bgetle4((bp)))
+ (int)((bp)->icount<=-4?((bp)->icount+=4,((bp)->ebuf[(bp)->icount-4])|((bp)->ebuf[(bp)->icount-3]<<8)|((bp)->ebuf[(bp)->icount-2]<<16)|((uint32)(bp)->ebuf[(bp)->icount-1]<<24)):Bgetle4((bp)))
/*
* These macros put 1-, 2-, and 4-byte integer values by writing the