This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

[PATCH]: swat a warning in solib.c


A common trick when using catch_errors is to pass an int argument
as a void* by casting it.  This generates warnings (if nothing else!)
when int and void* are not the same size.  Instead let's pass the
address of the int.

2000-03-23  Michael Snyder  <msnyder@cleaver.cygnus.com>

        * solib.c (open_symbol_file_object): to sneak an int argument 
        past catch_errors, instead of casting it to a pointer, simply
        pass it by address.

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.170
diff -c -r1.170 ChangeLog
*** ChangeLog	2000/03/23 23:43:19	1.170
--- ChangeLog	2000/03/24 00:46:04
***************
*** 1,3 ****
--- 1,9 ----
+ 2000-03-23  Michael Snyder  <msnyder@cleaver.cygnus.com>
+ 
+ 	* solib.c (open_symbol_file_object): to sneak an int argument 
+ 	past catch_errors, instead of casting it to a pointer, simply
+ 	pass it by address.
+ 
  2000-03-23  Fernando Nasser  <fnasser@cygnus.com>
  
  	From David Whedon <dwhedon@gordian.com>
Index: solib.c
===================================================================
RCS file: /cvs/src/src/gdb/solib.c,v
retrieving revision 1.6
diff -c -r1.6 solib.c
*** solib.c	2000/03/21 22:37:42	1.6
--- solib.c	2000/03/24 00:46:04
***************
*** 921,927 ****
  
    LOCAL FUNCTION
  
!   open_exec_file_object
  
    SYNOPSIS
  
--- 921,927 ----
  
    LOCAL FUNCTION
  
!   open_symbol_file_object
  
    SYNOPSIS
  
***************
*** 936,946 ****
  
   */
  
! int
! open_symbol_file_object (arg)
!      PTR arg;
  {
-   int from_tty = (int) arg;	/* sneak past catch_errors */
    CORE_ADDR lm;
    struct link_map lmcopy;
    char *filename;
--- 936,945 ----
  
   */
  
! static int
! open_symbol_file_object (from_ttyp)
!      int *from_ttyp;	/* sneak past catch_errors */
  {
    CORE_ADDR lm;
    struct link_map lmcopy;
    char *filename;
***************
*** 975,981 ****
  
    make_cleanup ((make_cleanup_func) free, (void *) filename);
    /* Have a pathname: read the symbol file.  */
!   symbol_file_command (filename, from_tty);
  
    return 1;
  }
--- 974,980 ----
  
    make_cleanup ((make_cleanup_func) free, (void *) filename);
    /* Have a pathname: read the symbol file.  */
!   symbol_file_command (filename, *from_ttyp);
  
    return 1;
  }
***************
*** 1234,1240 ****
       symbols now!  */
    if (attach_flag &&
        symfile_objfile == NULL)
!     catch_errors (open_symbol_file_object, (PTR) from_tty, 
  		  "Error reading attached process's symbol file.\n",
  		  RETURN_MASK_ALL);
  
--- 1233,1239 ----
       symbols now!  */
    if (attach_flag &&
        symfile_objfile == NULL)
!     catch_errors (open_symbol_file_object, (PTR) &from_tty, 
  		  "Error reading attached process's symbol file.\n",
  		  RETURN_MASK_ALL);
  

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