aboutsummaryrefslogtreecommitdiff
path: root/bfd/section.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-08-06 23:31:14 +0000
committerIan Lance Taylor <ian@airs.com>1999-08-06 23:31:14 +0000
commit22bc497dda9cf129165c5d704814a666ea4063c3 (patch)
treef57d34477a068d3241f0a169bbfb5ea1806641e1 /bfd/section.c
parent597e25914ec5895fba8097946514d4b8c878eb0a (diff)
downloadgdb-22bc497dda9cf129165c5d704814a666ea4063c3.zip
gdb-22bc497dda9cf129165c5d704814a666ea4063c3.tar.gz
gdb-22bc497dda9cf129165c5d704814a666ea4063c3.tar.bz2
* section.c (global_syms): Only initialize union field if
__STDC__.
Diffstat (limited to 'bfd/section.c')
-rw-r--r--bfd/section.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/bfd/section.c b/bfd/section.c
index 3e0aa2b..4f3edac 100644
--- a/bfd/section.c
+++ b/bfd/section.c
@@ -481,19 +481,27 @@ CODE_FRAGMENT
. ((section->reloc_done) ? (section)->_cooked_size: (abort(),1))
*/
+/* We use a macro to initialize the static asymbol structures because
+ traditional C does not permit us to initialize a union member while
+ gcc warns if we don't initialize it. */
+ /* the_bfd, name, value, attr, section [, udata] */
+#ifdef __STDC__
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+ { 0, NAME, 0, BSF_SECTION_SYM, (asection *) SECTION, { 0 }}
+#else
+#define GLOBAL_SYM_INIT(NAME, SECTION) \
+ { 0, NAME, 0, BSF_SECTION_SYM, (asection *) SECTION }
+#endif
+
/* These symbols are global, not specific to any BFD. Therefore, anything
that tries to change them is broken, and should be repaired. */
+
static const asymbol global_syms[] =
{
- /* the_bfd, name, value, attr, section [, udata] */
- {0, BFD_COM_SECTION_NAME, 0, BSF_SECTION_SYM,
- (asection *) &bfd_com_section, { 0 }},
- {0, BFD_UND_SECTION_NAME, 0, BSF_SECTION_SYM,
- (asection *) &bfd_und_section, { 0 }},
- {0, BFD_ABS_SECTION_NAME, 0, BSF_SECTION_SYM,
- (asection *) &bfd_abs_section, { 0 }},
- {0, BFD_IND_SECTION_NAME, 0, BSF_SECTION_SYM,
- (asection *) &bfd_ind_section, { 0 }},
+ GLOBAL_SYM_INIT (BFD_COM_SECTION_NAME, &bfd_com_section),
+ GLOBAL_SYM_INIT (BFD_UND_SECTION_NAME, &bfd_und_section),
+ GLOBAL_SYM_INIT (BFD_ABS_SECTION_NAME, &bfd_abs_section),
+ GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section)
};
#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \