2001-03-25 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 26 Mar 2001 02:50:46 +0000 (02:50 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Mon, 26 Mar 2001 02:50:46 +0000 (02:50 +0000)
From  Andrew Cagney  <ac131313@redhat.com>

        * coffread.c: Include "gdb_assert.h".
(coff_symtab_read): Cast the integer s_sclass to a long before
  casting it to a pointer.

gdb/ChangeLog
gdb/coffread.c

index 38efd9f4c0b3dfa668b9036b5afe39498fe812cc..f8538bdd8325705860b9c7011ac6f7be36a761b5 100644 (file)
@@ -1,3 +1,11 @@
+2001-03-25  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
+
+       From  Andrew Cagney  <ac131313@redhat.com>
+
+        * coffread.c: Include "gdb_assert.h".
+       (coff_symtab_read): Cast the integer s_sclass to a long before
+       casting it to a pointer.
+
 2001-03-25  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>
 
        From  Andrew Cagney  <ac131313@redhat.com>
index 7f775de49f23bc1462b5a4f15c5e1f994bbb3d31..a343a6825d5285133678e0875ccb8393e4cedc20 100644 (file)
@@ -43,6 +43,7 @@
 #include "stabsread.h"
 #include "complaints.h"
 #include "target.h"
+#include "gdb_assert.h"
 
 extern void _initialize_coffread (void);
 
@@ -966,9 +967,15 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
              {
                struct minimal_symbol *msym;
 
+               /* FIXME: cagney/2001-02-01: The nasty (int) -> (long)
+                   -> (void*) cast is to ensure that that the value of
+                   cs->c_sclass can be correctly stored in a void
+                   pointer in MSYMBOL_INFO.  Better solutions
+                   welcome. */
+               gdb_assert (sizeof (void *) >= sizeof (cs->c_sclass));
                msym = prim_record_minimal_symbol_and_info
-                 (cs->c_name, tmpaddr, ms_type, (char *) cs->c_sclass, sec,
-                  NULL, objfile);
+                 (cs->c_name, tmpaddr, ms_type, (void *) (long) cs->c_sclass,
+                  sec, NULL, objfile);
 #ifdef COFF_MAKE_MSYMBOL_SPECIAL
                if (msym)
                  COFF_MAKE_MSYMBOL_SPECIAL (cs->c_sclass, msym);