SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
35
devel/msp430/binutils/patches/patch-binutils_elfedit_c
Normal file
35
devel/msp430/binutils/patches/patch-binutils_elfedit_c
Normal file
|
@ -0,0 +1,35 @@
|
|||
Fix -Wbounded warnings by using correct casts.
|
||||
|
||||
--- binutils/elfedit.c.orig Fri Sep 30 16:29:00 2011
|
||||
+++ binutils/elfedit.c Fri Sep 30 16:33:14 2011
|
||||
@@ -169,6 +169,10 @@ update_elf_header (const char *file_name, FILE *file)
|
||||
static int
|
||||
get_file_header (FILE * file)
|
||||
{
|
||||
+ /* Temporary var to prevent the GCC -Wbounded checker from firing. */
|
||||
+ void *tmp32 = &ehdr32.e_type[0];
|
||||
+ void *tmp64 = &ehdr64.e_type[0];
|
||||
+
|
||||
/* Read in the identity array. */
|
||||
if (fread (elf_header.e_ident, EI_NIDENT, 1, file) != 1)
|
||||
return 0;
|
||||
@@ -198,8 +202,7 @@ get_file_header (FILE * file)
|
||||
return 0;
|
||||
|
||||
case ELFCLASS32:
|
||||
- if (fread (ehdr32.e_type, sizeof (ehdr32) - EI_NIDENT,
|
||||
- 1, file) != 1)
|
||||
+ if (fread (tmp32, sizeof (ehdr32) - EI_NIDENT, 1, file) != 1)
|
||||
return 0;
|
||||
|
||||
elf_header.e_type = BYTE_GET (ehdr32.e_type);
|
||||
@@ -231,8 +234,7 @@ get_file_header (FILE * file)
|
||||
return 0;
|
||||
}
|
||||
|
||||
- if (fread (ehdr64.e_type, sizeof (ehdr64) - EI_NIDENT,
|
||||
- 1, file) != 1)
|
||||
+ if (fread (tmp64, sizeof (ehdr64) - EI_NIDENT, 1, file) != 1)
|
||||
return 0;
|
||||
|
||||
elf_header.e_type = BYTE_GET (ehdr64.e_type);
|
Loading…
Add table
Add a link
Reference in a new issue