[Patch bfd] Remove unneeded comma expression from bfd_set_section_userdata, bfd_set_section_alignment, bfd_set_section_vma
Ramana Radhakrishnan
ramrad01@arm.com
Mon Jan 27 11:30:00 GMT 2014
Hi,
Our auto-tester of binutils with trunk gcc failed this morning with the
following.
In file included from src/binutils-gdb/gas
/as.h:95:0,
from src/binutils-gdb/gas/subsegs.c:25:
src/binutils-gdb/gas/subsegs.c: In function 'subseg_change':
../bfd/bfd.h:304:75: error: right-hand operand of comma expression has
no effect [-Werror=unused-value]
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata =
(val)),TRUE)
^
src/binutils-gdb/gas/subsegs.c:70:7: note: in expansion of macro
'bfd_set_section_userdata'
bfd_set_section_userdata (stdoutput, seg, seginfo);
^
src/binutils-gdb/gas/subsegs.c: In function 'subseg_get':
../bfd/bfd.h:304:75: error: right-hand operand of comma expression has
no effect [-Werror=unused-value]
#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata =
(val)),TRUE)
^
src/binutils-gdb/gas/subsegs.c:172:7: note: in expansion of macro
'bfd_set_section_userdata'
bfd_set_section_userdata (stdoutput, secptr, seginfo);
bfd_set_section_vma and bfd_set_section_alignment also appear to be
similarly afflicted as I worked through the problem.
I notice additional changes in bfd-in2.h after regeneration but this
appears to fix the build issue.
Tested with arm-linux-gnueabihf cross and no regressions.
Ok to commit ?
Cheers,
Ramana
* bfd/bfd-in.h (bfd_set_section_userdata): Fix definition.
(bfd_set_section_alignment): Likewise.
(bfd_set_section_vma): Likewise.
* bfd/bfd-in2.h: Regenerate.
-------------- next part --------------
diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h
index 3afd71b..26f408c 100644
--- a/bfd/bfd-in.h
+++ b/bfd/bfd-in.h
@@ -292,9 +292,9 @@ 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)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
+#define bfd_set_section_alignment(bfd, ptr, val) ((ptr)->alignment_power = (val))
+#define bfd_set_section_userdata(bfd, ptr, val) ((ptr)->userdata = (val))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 71996db..c6ba6a8 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -299,9 +299,9 @@ 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)
+#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE))
+#define bfd_set_section_alignment(bfd, ptr, val) ((ptr)->alignment_power = (val))
+#define bfd_set_section_userdata(bfd, ptr, val) ((ptr)->userdata = (val))
/* Find the address one past the end of SEC. */
#define bfd_get_section_limit(bfd, sec) \
(((bfd)->direction != write_direction && (sec)->rawsize != 0 \
@@ -1029,7 +1029,7 @@ bfd *bfd_openr (const char *filename, const char *target);
bfd *bfd_fdopenr (const char *filename, const char *target, int fd);
-bfd *bfd_openstreamr (const char *, const char *, void *);
+bfd *bfd_openstreamr (const char * filename, const char * target, void * stream);
bfd *bfd_openr_iovec (const char *filename, const char *target,
void *(*open_func) (struct bfd *nbfd,
More information about the Binutils
mailing list