enum name5 : long { "int" = 1, };
+enum name6 { "int" = 1, };
+
typealias floating_point {
exp_dig = 8; /* sizeof(float) * CHAR_BIT - FLT_MANT_DIG */
mant_dig = 24; /* FLT_MANT_DIG */
}
}
if (!container_type) {
- fprintf(fd, "[error] %s: missing container type for enumeration\n", __func__);
- return NULL;
-
+ declaration = lookup_declaration(g_quark_from_static_string("int"),
+ declaration_scope);
+ if (!declaration) {
+ fprintf(fd, "[error] %s: \"int\" type declaration missing for enumeration\n", __func__);
+ return NULL;
+ }
+ } else {
+ declaration = ctf_type_declarator_visit(fd, depth,
+ container_type,
+ &dummy_id, NULL,
+ declaration_scope,
+ NULL, trace);
}
- declaration = ctf_type_declarator_visit(fd, depth,
- container_type,
- &dummy_id, NULL,
- declaration_scope,
- NULL, trace);
if (!declaration) {
fprintf(fd, "[error] %s: unable to create container type for enumeration\n", __func__);
return NULL;
break;
case NODE_ENUM:
depth++;
- ret = ctf_visitor_parent_links(fd, depth + 1, node->u._enum.container_type);
- if (ret)
- return ret;
+ if (node->u._enum.container_type) {
+ ret = ctf_visitor_parent_links(fd, depth + 1, node->u._enum.container_type);
+ if (ret)
+ return ret;
+ }
cds_list_for_each_entry(iter, &node->u._enum.enumerator_list, siblings) {
iter->parent = node;
if (node->u._enum.container_type) {
print_tabs(fd, depth);
fprintf(fd, "<container_type>\n");
- }
-
- ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
- if (ret)
- return ret;
- if (node->u._enum.container_type) {
+ ret = ctf_visitor_print_xml(fd, depth + 1, node->u._enum.container_type);
+ if (ret)
+ return ret;
print_tabs(fd, depth);
fprintf(fd, "</container_type>\n");
}