aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-07-27 14:26:43 +0000
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>2007-07-27 14:26:43 +0000
commit2b8327ce6ab70ad4240aa99e6f67d823e5966724 (patch)
tree6147088e80b2ea736c45bd8f73774d61784096d3 /libgfortran
parent8fb632ebbee726472d103728d9a14c3bf437999e (diff)
downloadgcc-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')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/runtime/select.c16
2 files changed, 14 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 2b63dd1..fcb5f44 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2007-07-27 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/32035
+ * runtime/select.c (select_string): Adjust prototype and function
+ so that the return value is an integer, not a pointer.
+
2007-07-24 Tobias Burnus <burnus@net-b.de>
* libgfortran.h: Add bounds_check to compile_options_t.
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 */