Commit 7d71283c by Kaveh R. Ghazi Committed by Kaveh Ghazi

ada-tree.h (SET_TYPE_LANG_SPECIFIC, [...]): Fix -Wc++-compat warnings.

	* ada-tree.h (SET_TYPE_LANG_SPECIFIC, SET_DECL_LANG_SPECIFIC): Fix
	-Wc++-compat warnings.
	* adaint.c (__gnat_locate_regular_file, __gnat_locate_exec,
	__gnat_locate_exec_on_path): Likewise.
	* decl.c (annotate_value): Likewise.
	* misc.c (gnat_handle_option): Likewise.
	* trans.c (gnat_to_gnu, extract_encoding, decode_name,
	post_error_ne_tree): Likewise.

From-SVN: r137192
parent 5ead67f6
2008-06-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ada-tree.h (SET_TYPE_LANG_SPECIFIC, SET_DECL_LANG_SPECIFIC): Fix
-Wc++-compat warnings.
* adaint.c (__gnat_locate_regular_file, __gnat_locate_exec,
__gnat_locate_exec_on_path): Likewise.
* decl.c (annotate_value): Likewise.
* misc.c (gnat_handle_option): Likewise.
* trans.c (gnat_to_gnu, extract_encoding, decode_name,
post_error_ne_tree): Likewise.
2008-06-27 Eric Botcazou <ebotcazou@adacore.com> 2008-06-27 Eric Botcazou <ebotcazou@adacore.com>
* utils.c (convert) <CONSTRUCTOR>: When converting it to a packable * utils.c (convert) <CONSTRUCTOR>: When converting it to a packable
...@@ -39,7 +39,7 @@ struct lang_type GTY(()) {tree t; }; ...@@ -39,7 +39,7 @@ struct lang_type GTY(()) {tree t; };
#define SET_TYPE_LANG_SPECIFIC(NODE, X) \ #define SET_TYPE_LANG_SPECIFIC(NODE, X) \
(TYPE_LANG_SPECIFIC (NODE) \ (TYPE_LANG_SPECIFIC (NODE) \
= (TYPE_LANG_SPECIFIC (NODE) \ = (TYPE_LANG_SPECIFIC (NODE) \
? TYPE_LANG_SPECIFIC (NODE) : ggc_alloc (sizeof (struct lang_type)))) \ ? TYPE_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_type))) \
->t = X; ->t = X;
#define GET_DECL_LANG_SPECIFIC(NODE) \ #define GET_DECL_LANG_SPECIFIC(NODE) \
...@@ -47,7 +47,7 @@ struct lang_type GTY(()) {tree t; }; ...@@ -47,7 +47,7 @@ struct lang_type GTY(()) {tree t; };
#define SET_DECL_LANG_SPECIFIC(NODE, VALUE) \ #define SET_DECL_LANG_SPECIFIC(NODE, VALUE) \
(DECL_LANG_SPECIFIC (NODE) \ (DECL_LANG_SPECIFIC (NODE) \
= (DECL_LANG_SPECIFIC (NODE) \ = (DECL_LANG_SPECIFIC (NODE) \
? DECL_LANG_SPECIFIC (NODE) : ggc_alloc (sizeof (struct lang_decl)))) \ ? DECL_LANG_SPECIFIC (NODE) : GGC_NEW (struct lang_decl))) \
->t = VALUE; ->t = VALUE;
/* Flags added to GCC type nodes. */ /* Flags added to GCC type nodes. */
......
...@@ -2147,7 +2147,7 @@ char * ...@@ -2147,7 +2147,7 @@ char *
__gnat_locate_regular_file (char *file_name, char *path_val) __gnat_locate_regular_file (char *file_name, char *path_val)
{ {
char *ptr; char *ptr;
char *file_path = alloca (strlen (file_name) + 1); char *file_path = (char *) alloca (strlen (file_name) + 1);
int absolute; int absolute;
/* Return immediately if file_name is empty */ /* Return immediately if file_name is empty */
...@@ -2196,7 +2196,7 @@ __gnat_locate_regular_file (char *file_name, char *path_val) ...@@ -2196,7 +2196,7 @@ __gnat_locate_regular_file (char *file_name, char *path_val)
{ {
/* The result has to be smaller than path_val + file_name. */ /* The result has to be smaller than path_val + file_name. */
char *file_path = alloca (strlen (path_val) + strlen (file_name) + 2); char *file_path = (char *) alloca (strlen (path_val) + strlen (file_name) + 2);
for (;;) for (;;)
{ {
...@@ -2245,7 +2245,7 @@ __gnat_locate_exec (char *exec_name, char *path_val) ...@@ -2245,7 +2245,7 @@ __gnat_locate_exec (char *exec_name, char *path_val)
if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX)) if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX))
{ {
char *full_exec_name char *full_exec_name
= alloca (strlen (exec_name) + strlen (HOST_EXECUTABLE_SUFFIX) + 1); = (char *) alloca (strlen (exec_name) + strlen (HOST_EXECUTABLE_SUFFIX) + 1);
strcpy (full_exec_name, exec_name); strcpy (full_exec_name, exec_name);
strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX); strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX);
...@@ -2298,7 +2298,7 @@ __gnat_locate_exec_on_path (char *exec_name) ...@@ -2298,7 +2298,7 @@ __gnat_locate_exec_on_path (char *exec_name)
char *path_val = getenv ("PATH"); char *path_val = getenv ("PATH");
#endif #endif
if (path_val == NULL) return NULL; if (path_val == NULL) return NULL;
apath_val = alloca (strlen (path_val) + 1); apath_val = (char *) alloca (strlen (path_val) + 1);
strcpy (apath_val, path_val); strcpy (apath_val, path_val);
return __gnat_locate_exec (exec_name, apath_val); return __gnat_locate_exec (exec_name, apath_val);
#endif #endif
......
...@@ -6774,7 +6774,7 @@ annotate_value (tree gnu_size) ...@@ -6774,7 +6774,7 @@ annotate_value (tree gnu_size)
/* Save the result in the cache. */ /* Save the result in the cache. */
if (h) if (h)
{ {
*h = ggc_alloc (sizeof (struct tree_int_map)); *h = GGC_NEW (struct tree_int_map);
(*h)->base.from = gnu_size; (*h)->base.from = gnu_size;
(*h)->to = ret; (*h)->to = ret;
} }
......
...@@ -232,7 +232,7 @@ gnat_handle_option (size_t scode, const char *arg, int value) ...@@ -232,7 +232,7 @@ gnat_handle_option (size_t scode, const char *arg, int value)
switch (code) switch (code)
{ {
case OPT_I: case OPT_I:
q = xmalloc (sizeof("-I") + strlen (arg)); q = XNEWVEC (char, sizeof("-I") + strlen (arg));
strcpy (q, "-I"); strcpy (q, "-I");
strcat (q, arg); strcat (q, arg);
gnat_argv[gnat_argc] = q; gnat_argv[gnat_argc] = q;
...@@ -289,7 +289,7 @@ gnat_handle_option (size_t scode, const char *arg, int value) ...@@ -289,7 +289,7 @@ gnat_handle_option (size_t scode, const char *arg, int value)
case OPT_gnat: case OPT_gnat:
/* Recopy the switches without the 'gnat' prefix. */ /* Recopy the switches without the 'gnat' prefix. */
gnat_argv[gnat_argc] = xmalloc (strlen (arg) + 2); gnat_argv[gnat_argc] = XNEWVEC (char, strlen (arg) + 2);
gnat_argv[gnat_argc][0] = '-'; gnat_argv[gnat_argc][0] = '-';
strcpy (gnat_argv[gnat_argc] + 1, arg); strcpy (gnat_argv[gnat_argc] + 1, arg);
gnat_argc++; gnat_argc++;
......
...@@ -3273,7 +3273,7 @@ gnat_to_gnu (Node_Id gnat_node) ...@@ -3273,7 +3273,7 @@ gnat_to_gnu (Node_Id gnat_node)
int i; int i;
char *string; char *string;
if (length >= ALLOCA_THRESHOLD) if (length >= ALLOCA_THRESHOLD)
string = xmalloc (length + 1); /* in case of large strings */ string = XNEWVEC (char, length + 1); /* in case of large strings */
else else
string = (char *) alloca (length + 1); string = (char *) alloca (length + 1);
...@@ -6922,7 +6922,7 @@ set_expr_location_from_node (tree node, Node_Id gnat_node) ...@@ -6922,7 +6922,7 @@ set_expr_location_from_node (tree node, Node_Id gnat_node)
static const char * static const char *
extract_encoding (const char *name) extract_encoding (const char *name)
{ {
char *encoding = ggc_alloc (strlen (name)); char *encoding = GGC_NEWVEC (char, strlen (name));
get_encoding (name, encoding); get_encoding (name, encoding);
...@@ -6934,7 +6934,7 @@ extract_encoding (const char *name) ...@@ -6934,7 +6934,7 @@ extract_encoding (const char *name)
static const char * static const char *
decode_name (const char *name) decode_name (const char *name)
{ {
char *decoded = ggc_alloc (strlen (name) * 2 + 60); char *decoded = GGC_NEWVEC (char, strlen (name) * 2 + 60);
__gnat_decode (name, decoded, 0); __gnat_decode (name, decoded, 0);
...@@ -6998,7 +6998,7 @@ post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n) ...@@ -6998,7 +6998,7 @@ post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n)
void void
post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t) post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t)
{ {
char *newmsg = alloca (strlen (msg) + 1); char *newmsg = XALLOCAVEC (char, strlen (msg) + 1);
String_Template temp = {1, 0}; String_Template temp = {1, 0};
Fat_Pointer fp; Fat_Pointer fp;
char start_yes, end_yes, start_no, end_no; char start_yes, end_yes, start_no, end_no;
......
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