diff options
author | Andrew Cagney <cagney@redhat.com> | 2000-03-04 00:40:40 +0000 |
---|---|---|
committer | Andrew Cagney <cagney@redhat.com> | 2000-03-04 00:40:40 +0000 |
commit | e400552667bfce4e8569944fa28fa87e65bbdfcc (patch) | |
tree | 4b95a234f538f509c834e1674cfa18f729fbc246 /gdb/defs.h | |
parent | 6dcbc97b8aa6c242af3db99f9b568868f8c502c7 (diff) | |
download | gdb-e400552667bfce4e8569944fa28fa87e65bbdfcc.zip gdb-e400552667bfce4e8569944fa28fa87e65bbdfcc.tar.gz gdb-e400552667bfce4e8569944fa28fa87e65bbdfcc.tar.bz2 |
Convert make_cleanup functions to ISO-C.
Diffstat (limited to 'gdb/defs.h')
-rw-r--r-- | gdb/defs.h | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -293,24 +293,36 @@ extern void discard_final_cleanups (struct cleanup *); extern void discard_exec_error_cleanups (struct cleanup *); extern void discard_my_cleanups (struct cleanup **, struct cleanup *); +/* DEPRECATED: cagney/2000-03-04: Do not use this typedef to cast + function pointers so that they match the argument to the various + cleanup functions. Post GDB 5.0, this typedef will be + deleted. [Editors note: cagney was the person that added most of + those type casts] */ typedef void (*make_cleanup_func) (void *); -extern struct cleanup *make_cleanup (make_cleanup_func, void *); +/* NOTE: cagney/2000-03-04: This typedef is strictly for the + make_cleanup function declarations below. Do not use this typedef + as a cast when passing functions into the make_cleanup() code. + Instead either use a bounce function or add a wrapper function. + Calling a f(char*) function with f(void*) is non-portable. */ +typedef void (make_cleanup_ftype) (void *); + +extern struct cleanup *make_cleanup (make_cleanup_ftype *, void *); extern struct cleanup *make_cleanup_freeargv (char **); struct ui_file; extern struct cleanup *make_cleanup_ui_file_delete (struct ui_file *); -extern struct cleanup *make_final_cleanup (make_cleanup_func, void *); +extern struct cleanup *make_final_cleanup (make_cleanup_ftype *, void *); extern struct cleanup *make_my_cleanup (struct cleanup **, - make_cleanup_func, void *); + make_cleanup_ftype *, void *); -extern struct cleanup *make_run_cleanup (make_cleanup_func, void *); +extern struct cleanup *make_run_cleanup (make_cleanup_ftype *, void *); -extern struct cleanup *make_exec_cleanup (make_cleanup_func, void *); -extern struct cleanup *make_exec_error_cleanup (make_cleanup_func, void *); +extern struct cleanup *make_exec_cleanup (make_cleanup_ftype *, void *); +extern struct cleanup *make_exec_error_cleanup (make_cleanup_ftype *, void *); extern struct cleanup *save_cleanups (void); extern struct cleanup *save_final_cleanups (void); |