This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Fix warning from hpux-core.c


This change fixes three warnings from hpux-core.c when compiled on
hppa64-hp-hpux11.11.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2004-11-20  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* hpux-core.c (hpux_core_core_file_p): Use offsetof macro in calls to
	make_bfd_asection.

Index: hpux-core.c
===================================================================
RCS file: /cvs/src/src/bfd/hpux-core.c,v
retrieving revision 1.14
diff -u -3 -p -r1.14 hpux-core.c
--- hpux-core.c	13 Sep 2004 03:51:22 -0000	1.14
+++ hpux-core.c	20 Nov 2004 16:33:06 -0000
@@ -244,10 +244,11 @@ hpux_core_core_file_p (abfd)
             if (core_kernel_thread_id (abfd) == 0)
               {
                 if (!make_bfd_asection (abfd, ".reg",
-                                        SEC_HAS_CONTENTS,
-                                        core_header.len,
-                                        (int) &proc_info - (int) & proc_info.hw_regs,
-                                        2))
+					SEC_HAS_CONTENTS,
+					core_header.len,
+					(bfd_vma) offsetof (struct proc_info,
+							    hw_regs),
+					2))
 		  goto fail;
               }
             else
@@ -259,17 +260,19 @@ hpux_core_core_file_p (abfd)
 		    if (!make_bfd_asection (abfd, ".reg",
 					    SEC_HAS_CONTENTS,
 					    core_header.len,
-					    (int) &proc_info - (int) & proc_info.hw_regs,
+					    (bfd_vma)offsetof (struct proc_info,
+							       hw_regs),
 					    2))
 		      goto fail;
                   }
                 /* We always make one of these sections, for every thread. */
                 sprintf (secname, ".reg/%d", core_kernel_thread_id (abfd));
                 if (!make_bfd_asection (abfd, secname,
-                                        SEC_HAS_CONTENTS,
-                                        core_header.len,
-                                        (int) &proc_info - (int) & proc_info.hw_regs,
-                                        2))
+					SEC_HAS_CONTENTS,
+					core_header.len,
+					(bfd_vma) offsetof (struct proc_info,
+							    hw_regs),
+					2))
 		  goto fail;
               }
 	    core_signal (abfd) = proc_info.sig;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]