Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106041000
D12928.id34712.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12928.id34712.diff
View Options
Index: contrib/binutils/bfd/elflink.c
===================================================================
--- contrib/binutils/bfd/elflink.c
+++ contrib/binutils/bfd/elflink.c
@@ -4815,7 +4815,7 @@
len = strlen (name);
copy = bfd_alloc (abfd, len);
if (copy == NULL)
- return (struct elf_link_hash_entry *) 0 - 1;
+ return (struct elf_link_hash_entry *)(intptr_t)-1;
first = p - name + 1;
memcpy (copy, name, first);
@@ -4927,7 +4927,7 @@
}
h = archive_symbol_lookup (abfd, info, symdef->name);
- if (h == (struct elf_link_hash_entry *) 0 - 1)
+ if (h == (struct elf_link_hash_entry *)(intptr_t)-1)
goto error_return;
if (h == NULL)
Index: contrib/binutils/include/obstack.h
===================================================================
--- contrib/binutils/include/obstack.h
+++ contrib/binutils/include/obstack.h
@@ -113,17 +113,17 @@
#ifdef __cplusplus
extern "C" {
#endif
-
+/* XXXAR: This is undefined behaviour and what does the comment mean anyway? */
/* We use subtraction of (char *) 0 instead of casting to int
because on word-addressable machines a simple cast to int
may ignore the byte-within-word field of the pointer. */
#ifndef __PTR_TO_INT
-# define __PTR_TO_INT(P) ((P) - (char *) 0)
+# define __PTR_TO_INT(P) ((intptr_t)(P))
#endif
#ifndef __INT_TO_PTR
-# define __INT_TO_PTR(P) ((P) + (char *) 0)
+# define __INT_TO_PTR(P) ((void*)(intptr_t)(P))
#endif
/* We need the type of the resulting object. If __PTRDIFF_TYPE__ is
@@ -427,7 +427,7 @@
__o1->maybe_empty_object = 1; \
__o1->next_free \
= __INT_TO_PTR ((__PTR_TO_INT (__o1->next_free)+__o1->alignment_mask)\
- & ~ (__o1->alignment_mask)); \
+ & ~(intptr_t)(__o1->alignment_mask)); \
if (__o1->next_free - (char *)__o1->chunk \
> __o1->chunk_limit - (char *)__o1->chunk) \
__o1->next_free = __o1->chunk_limit; \
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:32 AM (9 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15595834
Default Alt Text
D12928.id34712.diff (1 KB)
Attached To
Mode
D12928: Fix new -Werror compiler warnings in binutils
Attached
Detach File
Event Timeline
Log In to Comment