mirror of
https://github.com/crash-utility/crash
synced 2025-01-18 23:00:42 +00:00
Fix failure to build from source when compiling the crash utility
with gcc-4.9. Without the patch, the crash utility build generates the following error: In file included from opncls.c:26:0: opncls.c: In function 'bfd_fopen': bfd.h:529:65: error: right-hand operand of comma expression has no effect [-Werror=unused-value] #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) ^ opncls.c:263:5: note: in expansion of macro 'bfd_set_cacheable' bfd_set_cacheable (nbfd, TRUE); cc1: all warnings being treated as errors (anderson@redhat.com, anatol.pomozov@gmail.com)
This commit is contained in:
parent
0ead5809b9
commit
2e6d26effb
@ -1561,3 +1561,91 @@
|
||||
if (build_address_symbolic (gdbarch, addr, do_demangle, &name, &offset,
|
||||
&filename, &line, &unmapped))
|
||||
{
|
||||
--- gdb-7.6/bfd/bfd-in.h.orig
|
||||
+++ gdb-7.6/bfd/bfd-in.h
|
||||
@@ -294,9 +294,6 @@ typedef struct bfd_section *sec_ptr;
|
||||
|
||||
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
||||
|
||||
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
|
||||
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
|
||||
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
|
||||
/* Find the address one past the end of SEC. */
|
||||
#define bfd_get_section_limit(bfd, sec) \
|
||||
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
|
||||
@@ -519,7 +516,6 @@ extern void warn_deprecated (const char
|
||||
|
||||
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
||||
|
||||
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
|
||||
|
||||
extern bfd_boolean bfd_cache_close
|
||||
(bfd *abfd);
|
||||
--- gdb-7.6/bfd/bfd-in2.h.orig
|
||||
+++ gdb-7.6/bfd/bfd-in2.h
|
||||
@@ -301,9 +301,6 @@ typedef struct bfd_section *sec_ptr;
|
||||
|
||||
#define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0)
|
||||
|
||||
-#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
|
||||
-#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
|
||||
-#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
|
||||
/* Find the address one past the end of SEC. */
|
||||
#define bfd_get_section_limit(bfd, sec) \
|
||||
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
|
||||
@@ -526,7 +523,6 @@ extern void warn_deprecated (const char
|
||||
|
||||
#define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char)
|
||||
|
||||
-#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
|
||||
|
||||
extern bfd_boolean bfd_cache_close
|
||||
(bfd *abfd);
|
||||
@@ -1572,6 +1568,32 @@ struct relax_table {
|
||||
int size;
|
||||
};
|
||||
|
||||
+/* Note: the following are provided as inline functions rather than macros
|
||||
+ because not all callers use the return value. A macro implementation
|
||||
+ would use a comma expression, eg: "((ptr)->foo = val, TRUE)" and some
|
||||
+ compilers will complain about comma expressions that have no effect. */
|
||||
+static inline bfd_boolean
|
||||
+bfd_set_section_userdata (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, void * val)
|
||||
+{
|
||||
+ ptr->userdata = val;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static inline bfd_boolean
|
||||
+bfd_set_section_vma (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, bfd_vma val)
|
||||
+{
|
||||
+ ptr->vma = ptr->lma = val;
|
||||
+ ptr->user_set_vma = TRUE;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static inline bfd_boolean
|
||||
+bfd_set_section_alignment (bfd * abfd ATTRIBUTE_UNUSED, asection * ptr, unsigned int val)
|
||||
+{
|
||||
+ ptr->alignment_power = val;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
/* These sections are global, and are managed by BFD. The application
|
||||
and target back end are not permitted to change the values in
|
||||
these sections. */
|
||||
@@ -6095,6 +6117,14 @@ struct bfd
|
||||
unsigned int selective_search : 1;
|
||||
};
|
||||
|
||||
+/* See note beside bfd_set_section_userdata. */
|
||||
+static inline bfd_boolean
|
||||
+bfd_set_cacheable (bfd * abfd, bfd_boolean val)
|
||||
+{
|
||||
+ abfd->cacheable = val;
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
typedef enum bfd_error
|
||||
{
|
||||
bfd_error_no_error = 0,
|
||||
|
Loading…
Reference in New Issue
Block a user