diff options
author | Russ Cox <rsc@golang.org> | 2023-07-31 12:30:43 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2023-07-31 19:10:10 +0000 |
commit | ceb95ea6aef52c1fb472d3539c6ef68670778b5b (patch) | |
tree | 37575761e3b271cbe50a2e37babb9434495c2cd2 /src/cmd/ld/dwarf.c | |
parent | bdd4b9503e47c2c38a9d0a9bb2f5d95ec5ff8ef6 (diff) | |
download | go-ceb95ea6aef52c1fb472d3539c6ef68670778b5b.tar.gz go-ceb95ea6aef52c1fb472d3539c6ef68670778b5b.zip |
[release-branch.go1.4] all: fixes for modern compilersrelease-branch.go1.4
This makes make.bash pass without any warnings for
$ clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$
The change in src/liblink/asm5.c silences a warning building
on modern macOS, which doesn't actually produce a working
toolchain anyway, but it still seems worth silencing the warning.
These warnings surface now in the reproducible builds reports
(for example https://gorebuild.storage.googleapis.com/gorebuild.html,
click on "Bootstrap go1.4"). I'd rather not look at them anymore.
For golang/go#58884.
Change-Id: I689c862ad360ca23153438f9e143a1cb840730e4
Reviewed-on: https://go-review.googlesource.com/c/go/+/514415
TryBot-Bypass: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/cmd/ld/dwarf.c')
-rw-r--r-- | src/cmd/ld/dwarf.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c index dfe515c3c4..15db46c2dc 100644 --- a/src/cmd/ld/dwarf.c +++ b/src/cmd/ld/dwarf.c @@ -86,7 +86,7 @@ addrput(vlong addr) } static int -uleb128enc(uvlong v, char* dst) +uleb128enc(uvlong v, uchar* dst) { uint8 c, len; @@ -104,7 +104,7 @@ uleb128enc(uvlong v, char* dst) }; static int -sleb128enc(vlong v, char *dst) +sleb128enc(vlong v, uchar *dst) { uint8 c, s, len; @@ -125,15 +125,15 @@ sleb128enc(vlong v, char *dst) static void uleb128put(vlong v) { - char buf[10]; - strnput(buf, uleb128enc(v, buf)); + uchar buf[10]; + strnput((char*)buf, uleb128enc(v, buf)); } static void sleb128put(vlong v) { - char buf[10]; - strnput(buf, sleb128enc(v, buf)); + uchar buf[10]; + strnput((char*)buf, sleb128enc(v, buf)); } /* @@ -854,7 +854,7 @@ reversetree(DWDie** list) static void newmemberoffsetattr(DWDie *die, int32 offs) { - char block[10]; + uchar block[10]; int i; i = 0; @@ -1471,7 +1471,7 @@ putpclcdelta(vlong delta_pc, vlong delta_lc) static void newcfaoffsetattr(DWDie *die, int32 offs) { - char block[10]; + uchar block[10]; int i; i = 0; @@ -1760,7 +1760,7 @@ writeframes(void) uleb128put(DWARFREGSP); // register SP (**ABI-dependent, defined in l.h) uleb128put(PtrSize); // offset - cput(DW_CFA_offset + FAKERETURNCOLUMN); // return address + cput((char)(DW_CFA_offset + FAKERETURNCOLUMN)); // return address uleb128put(-PtrSize / DATAALIGNMENTFACTOR); // at cfa - x*4 // 4 is to exclude the length field. |