+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>
* utils.c (convert) <CONSTRUCTOR>: When converting it to a packable
#define SET_TYPE_LANG_SPECIFIC(NODE, X) \
(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;
#define GET_DECL_LANG_SPECIFIC(NODE) \
#define SET_DECL_LANG_SPECIFIC(NODE, VALUE) \
(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;
/* Flags added to GCC type nodes. */
__gnat_locate_regular_file (char *file_name, char *path_val)
{
char *ptr;
- char *file_path = alloca (strlen (file_name) + 1);
+ char *file_path = (char *) alloca (strlen (file_name) + 1);
int absolute;
/* Return immediately if file_name is empty */
{
/* 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 (;;)
{
if (!strstr (exec_name, HOST_EXECUTABLE_SUFFIX))
{
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);
strcat (full_exec_name, HOST_EXECUTABLE_SUFFIX);
char *path_val = getenv ("PATH");
#endif
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);
return __gnat_locate_exec (exec_name, apath_val);
#endif
/* Save the result in the cache. */
if (h)
{
- *h = ggc_alloc (sizeof (struct tree_int_map));
+ *h = GGC_NEW (struct tree_int_map);
(*h)->base.from = gnu_size;
(*h)->to = ret;
}
switch (code)
{
case OPT_I:
- q = xmalloc (sizeof("-I") + strlen (arg));
+ q = XNEWVEC (char, sizeof("-I") + strlen (arg));
strcpy (q, "-I");
strcat (q, arg);
gnat_argv[gnat_argc] = q;
case OPT_gnat:
/* 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] = '-';
strcpy (gnat_argv[gnat_argc] + 1, arg);
gnat_argc++;
int i;
char *string;
if (length >= ALLOCA_THRESHOLD)
- string = xmalloc (length + 1); /* in case of large strings */
+ string = XNEWVEC (char, length + 1); /* in case of large strings */
else
string = (char *) alloca (length + 1);
static const char *
extract_encoding (const char *name)
{
- char *encoding = ggc_alloc (strlen (name));
+ char *encoding = GGC_NEWVEC (char, strlen (name));
get_encoding (name, encoding);
static const char *
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);
void
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};
Fat_Pointer fp;
char start_yes, end_yes, start_no, end_no;