Commit fc4054d7 authored by Marius Gerbershagen's avatar Marius Gerbershagen
Browse files

fix some compiler warnings

__attribute__((unused)) suppresses unused variable warnings for
the_env in dpp generated code.

:case keyword argument in translate-pathname is unused and not
required by the ANSI spec.

espace_flag in sharp_colon_reader is unused and not necessary for the
current implementation.

ihs_function_name is unused and duplicated as ihs-fname in lsp/top.lsp
parent 594d47f2
......@@ -102,7 +102,6 @@ ecl_string_case(cl_object s)
/* Returns 1 if string is all uppercase, -1 if all lowercase, and 0 if mixed case */
int upcase;
cl_index i;
ecl_base_char *text;
switch (ecl_t_of(s)) {
#ifdef ECL_UNICODE
......
......@@ -723,14 +723,11 @@ put_declaration(void)
put_lineno();
the_env_defined = 1;
fprintf(out,
"#ifdef __clang__\n"
"#pragma clang diagnostic push\n"
"#pragma clang diagnostic ignored \"-Wunused-variable\"\n"
"#endif\n"
"#if defined(__clang__) || defined(__GNUC__)\n"
"\t__attribute__((unused)) const cl_env_ptr the_env = ecl_process_env();\n"
"#else\n"
"\tconst cl_env_ptr the_env = ecl_process_env();\n"
"#ifdef __clang__\n"
"#pragma clang diagnostic pop\n"
"#endif\n" );
"#endif\n");
for (i = 0; i < nopt; i++) {
put_lineno();
fprintf(out, "\tcl_object %s;\n", optional[i].o_var);
......
......@@ -1709,7 +1709,7 @@ copy_list_wildcards(cl_object *wilds, cl_object to)
return l;
}
@(defun translate-pathname (source from to &key ((:case scase) @':local'))
@(defun translate-pathname (source from to &key)
cl_object wilds, d;
cl_object host, device, directory, name, type, version;
cl_object fromcase, tocase;
......
......@@ -962,7 +962,6 @@ sharp_colon_reader(cl_object in, cl_object ch, cl_object d)
{
cl_object rtbl = ecl_current_readtable();
enum ecl_chattrib a;
bool escape_flag;
int c;
cl_object output, token;
......@@ -970,7 +969,6 @@ sharp_colon_reader(cl_object in, cl_object ch, cl_object d)
extra_argument(':', in, d);
c = ecl_read_char_noeof(in);
a = ecl_readtable_get(rtbl, c, NULL);
escape_flag = FALSE;
token = si_get_buffer_string();
goto L;
for (;;) {
......@@ -984,9 +982,7 @@ sharp_colon_reader(cl_object in, cl_object ch, cl_object d)
if (a == cat_single_escape) {
c = ecl_read_char_noeof(in);
a = cat_constituent;
escape_flag = TRUE;
} else if (a == cat_multiple_escape) {
escape_flag = TRUE;
for (;;) {
c = ecl_read_char_noeof(in);
a = ecl_readtable_get(rtbl, c, NULL);
......
......@@ -435,34 +435,6 @@ ecl_bds_set(cl_env_ptr env, cl_object s, cl_object value)
/******************** INVOCATION STACK **********************/
static cl_object
ihs_function_name(cl_object x)
{
cl_object y;
switch (ecl_t_of(x)) {
case t_symbol:
return(x);
case t_bclosure:
x = x->bclosure.code;
case t_bytecodes:
y = x->bytecodes.name;
if (Null(y))
return(@'lambda');
else
return y;
case t_cfun:
case t_cfunfixed:
return(x->cfun.name);
default:
return(ECL_NIL);
}
}
static ecl_ihs_ptr
get_ihs_ptr(cl_index n)
{
......
......@@ -198,7 +198,6 @@ mp_get_rwlock_write_nowait(cl_object lock)
cl_object
mp_get_rwlock_write_wait(cl_object lock)
{
cl_env_ptr env = ecl_process_env();
if (ecl_t_of(lock) != t_rwlock)
FEerror_not_a_rwlock(lock);
#ifdef ECL_RWLOCK
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment