diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-07-27 14:26:43 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2007-07-27 14:26:43 +0000 |
commit | 2b8327ce6ab70ad4240aa99e6f67d823e5966724 (patch) | |
tree | 6147088e80b2ea736c45bd8f73774d61784096d3 /libgfortran/runtime/select.c | |
parent | 8fb632ebbee726472d103728d9a14c3bf437999e (diff) | |
download | gcc-2b8327ce6ab70ad4240aa99e6f67d823e5966724.zip gcc-2b8327ce6ab70ad4240aa99e6f67d823e5966724.tar.gz gcc-2b8327ce6ab70ad4240aa99e6f67d823e5966724.tar.bz2 |
re PR fortran/32035 ('<anonymous>' may be used uninitialized in this function)
PR fortran/32035
* trans-stmt.c (gfc_trans_character_select): Replace the
mechanism with labels by a SWITCH_EXPR.
* trans-decl.c (gfc_build_builtin_function_decls): Change
return type for select_string.
* runtime/select.c (select_string): Adjust prototype and function
so that the return value is an integer, not a pointer.
* gfortran.dg/select_char_1.f90: New test.
From-SVN: r126978
Diffstat (limited to 'libgfortran/runtime/select.c')
-rw-r--r-- | libgfortran/runtime/select.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libgfortran/runtime/select.c b/libgfortran/runtime/select.c index 4421e02..cecd025 100644 --- a/libgfortran/runtime/select.c +++ b/libgfortran/runtime/select.c @@ -35,28 +35,28 @@ typedef struct int low_len; char *high; int high_len; - void *address; + int address; } select_struct; -extern void * select_string (select_struct *table, int table_len, - void *default_jump, const char *selector, - int selector_len); +extern int select_string (select_struct *table, int table_len, + const char *selector, int selector_len); export_proto(select_string); /* select_string()-- Given a selector string and a table of * select_struct structures, return the address to jump to. */ -void * -select_string (select_struct *table, int table_len, void *default_jump, - const char *selector, int selector_len) +int +select_string (select_struct *table, int table_len, const char *selector, + int selector_len) { select_struct *t; int i, low, high, mid; + int default_jump; if (table_len == 0) - return default_jump; + return -1; /* Record the default address if present */ |