expr.c (build_chill_function_call): Don't call a variadic function with a non-literal format string.

* 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.

From-SVN: r30640
This commit is contained in:
Kaveh R. Ghazi 1999-11-23 15:53:22 +00:00 committed by Kaveh Ghazi
parent de6e505ec7
commit a3dd1d4395
6 changed files with 53 additions and 43 deletions

View File

@ -1,3 +1,18 @@
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

View File

@ -2512,20 +2512,20 @@ build_chill_function_call (function, expr)
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;
}

View File

@ -2829,9 +2829,8 @@ really_grant_this (decl, granted_decls)
/* 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)
@ -2850,8 +2849,8 @@ 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;
}

View File

@ -332,11 +332,7 @@ require(token)
enum terminal token;
{
if (PEEK_TOKEN() != token)
{
char buf[80];
sprintf (buf, "internal parser error - expected token %d", (int)token);
fatal(buf);
}
fatal ("internal parser error - expected token %d", (int)token);
FORWARD_TOKEN();
}
@ -361,7 +357,7 @@ expect(token, message)
if (PEEK_TOKEN() != token)
{
if (pass == 1)
error(message ? message : "syntax error");
error("%s", message ? message : "syntax error");
return 0;
}
else

View File

@ -69,18 +69,19 @@ tree tasking_list = NULL_TREE;
#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;
@ -92,9 +93,9 @@ get_struct_type_name (name)
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);
}
@ -103,9 +104,9 @@ get_struct_debug_type_name (name)
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);
}
@ -114,12 +115,11 @@ tree
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);
}
@ -129,9 +129,9 @@ get_struct_variable_name (name)
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
@ -141,9 +141,9 @@ get_process_wrapper_name (name)
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);
}
@ -627,19 +627,19 @@ build_start_process (process_name, copynum,
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
{

View File

@ -155,7 +155,7 @@ valid_array_index_p (array, idx, error_message, is_varying_lhs)
{
if (tree_int_cst_equal (cond, boolean_false_node))
return idx; /* condition met at compile time */
error (error_message); /* condition failed at compile time */
error ("%s", error_message); /* condition failed at compile time */
return error_mark_node;
}
else if (range_checking)