diff options
author | Nick Clifton <nickc@redhat.com> | 2020-02-07 12:49:42 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-02-07 12:49:42 +0000 |
commit | e1104d08fe2fbfabcfa98aa00525211e47548bd8 (patch) | |
tree | 323997153d1ea9702dd457e07f17bf0e17077b99 /binutils/dwarf.c | |
parent | 9b538ba71fc7dbab65371e3e4e5f7e093ff25023 (diff) | |
download | gdb-e1104d08fe2fbfabcfa98aa00525211e47548bd8.zip gdb-e1104d08fe2fbfabcfa98aa00525211e47548bd8.tar.gz gdb-e1104d08fe2fbfabcfa98aa00525211e47548bd8.tar.bz2 |
Silcence a compile time warning message building the binutils with gcc-10 on an s390 host.
* dwarf.c (display_debug_lines_decoded): Force a NUL termination
of the truncated file name.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 35842f7..6ecfab5 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -4905,6 +4905,11 @@ display_debug_lines_decoded (struct dwarf_section * section, strncpy (newFileName, fileName + fileNameLength - MAX_FILENAME_LENGTH, MAX_FILENAME_LENGTH + 1); + /* FIXME: This is to pacify gcc-10 which can warn that the + strncpy above might leave a non-NUL terminated string + in newFileName. It won't, but gcc's analysis doesn't + quite go far enough to discover this. */ + newFileName[MAX_FILENAME_LENGTH] = 0; } else { |