+1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * expr.c (build_chill_function_call): Don't call a variadic
+ function with a non-literal format string.
+
+ * grant.c (write_spec_module): Likewise.
+
+ * parse.c (require, expect): Likewise.
+
+ * tasking.c (get_struct_type_name, get_struct_debug_type_name,
+ get_tasking_code_name, get_struct_variable_name,
+ get_process_wrapper_name, build_start_process): Likewise.
+
+ * typeck.c (valid_array_index_p): Likewise.
+
Sun Oct 31 22:33:33 1999 Jeffrey A Law (law@cygnus.com)
* Makefile.in (convert.o, typeck.o): Depend on output.h
if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
{
- const char *errstr = "too many arguments to procedure";
if (name)
- error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
+ error ("too many arguments to procedure `%s'",
+ IDENTIFIER_POINTER (name));
else
- error (errstr);
+ error ("too many arguments to procedure");
return error_mark_node;
}
else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
{
- const char *errstr = "too few arguments to procedure";
if (name)
- error ("%s `%s'", errstr, IDENTIFIER_POINTER (name));
+ error ("too few arguments to procedure `%s'",
+ IDENTIFIER_POINTER (name));
else
- error (errstr);
+ error ("too few arguments to procedure");
return error_mark_node;
}
\f
/* Write a SPEC MODULE using the declarations in the list DECLS. */
static int header_written = 0;
-static const char *header_template =
-"--\n-- WARNING: this file was generated by\n\
--- GNUCHILL version %s\n-- based on gcc version %s\n--\n";
+#define HEADER_TEMPLATE "--\n-- WARNING: this file was generated by\n\
+-- GNUCHILL version %s\n-- based on gcc version %s\n--\n"
void
write_spec_module (decls, granted_decls)
{
hdr = (char*) alloca (strlen (gnuchill_version)
+ strlen (version_string)
- + strlen (header_template) + 1);
- sprintf (hdr, header_template, gnuchill_version, version_string);
+ + sizeof (HEADER_TEMPLATE) /* includes \0 */);
+ sprintf (hdr, HEADER_TEMPLATE, gnuchill_version, version_string);
APPEND (gstring, hdr);
header_written = 1;
}
#define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4)
/* name template for process argument type */
-static const char * struct_name = "__tmp_%s_arg_type";
+#define STRUCT_NAME "__tmp_%s_arg_type"
/* name template for process arguments for debugging type */
-static const char * struct_debug_name = "__tmp_%s_debug_type";
+#define STRUCT_DEBUG_NAME "__tmp_%s_debug_type"
-#if 0
/* name template for process argument variable */
-static const char * data_name = "__tmp_%s_arg_variable";
-#endif
+#define DATA_NAME "__tmp_%s_arg_variable"
/* name template for process wrapper */
-static const char * wrapper_name = "__tmp_%s_wrapper";
+#define WRAPPER_NAME "__tmp_%s_wrapper"
+
+/* name template for process code */
+#define SKELNAME "__tmp_%s_code"
extern int ignoring;
static tree void_ftype_void;
tree name;
{
const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + strlen (struct_name) + 1);
+ char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_NAME));
- sprintf (tmpname, struct_name, idp);
+ sprintf (tmpname, STRUCT_NAME, idp);
return get_identifier (tmpname);
}
tree name;
{
const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + strlen (struct_debug_name) + 1);
+ char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_DEBUG_NAME));
- sprintf (tmpname, struct_debug_name, idp);
+ sprintf (tmpname, STRUCT_DEBUG_NAME, idp);
return get_identifier (tmpname);
}
get_tasking_code_name (name)
tree name;
{
- const char *skelname = "__tmp_%s_code";
const char *name_str = IDENTIFIER_POINTER (name);
- char *tmpname = (char *)alloca (IDENTIFIER_LENGTH (name) +
- strlen (skelname) + 1);
-
- sprintf (tmpname, skelname, name_str);
+ char *tmpname = (char *) alloca (IDENTIFIER_LENGTH (name) +
+ sizeof (SKELNAME));
+
+ sprintf (tmpname, SKELNAME, name_str);
return get_identifier (tmpname);
}
tree name;
{
const char *idp = IDENTIFIER_POINTER (name); /* process name */
- char *tmpname = xmalloc (strlen (idp) + strlen (data_name) + 1);
+ char *tmpname = xmalloc (strlen (idp) + sizeof (DATA_NAME));
- sprintf (tmpname, data_name, idp);
+ sprintf (tmpname, DATA_NAME, idp);
return get_identifier (tmpname);
}
#endif
tree name;
{
const char *idp = IDENTIFIER_POINTER (name);
- char *tmpname = xmalloc (strlen (idp) + strlen (wrapper_name) + 1);
+ char *tmpname = xmalloc (strlen (idp) + sizeof (WRAPPER_NAME));
- sprintf (tmpname, wrapper_name, idp);
+ sprintf (tmpname, WRAPPER_NAME, idp);
return get_identifier (tmpname);
}
\f
if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
{
- const char *errstr = "too many arguments to process";
if (process_name)
- error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
+ error ("too many arguments to process `%s'",
+ IDENTIFIER_POINTER (process_name));
else
- error (errstr);
+ error ("too many arguments to process");
}
else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
{
- const char *errstr = "too few arguments to process";
if (process_name)
- error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
+ error ("too few arguments to process `%s'",
+ IDENTIFIER_POINTER (process_name));
else
- error (errstr);
+ error ("too few arguments to process");
}
else
{