Fix: uninitialized variable may be used warning
[babeltrace.git] / plugins / ctf / common / metadata / visitor-generate-ir.c
index aae7322bc8b21069c442ea99805c605f0bb693a7..734ed996840b144b9f9844eebe1169ae8662bbe4 100644 (file)
@@ -3258,7 +3258,7 @@ int visit_event_decl_entry(struct ctx *ctx, struct ctf_node *node,
 
                        _SET(set, _EVENT_NAME_SET);
                } else if (!strcmp(left, "id")) {
-                       int64_t id;
+                       int64_t id = -1;
 
                        if (_IS_SET(set, _EVENT_ID_SET)) {
                                _BT_LOGE_DUP_ATTR(node, "id",
@@ -4873,7 +4873,7 @@ int visit_clock_decl_entry(struct ctx *ctx, struct ctf_node *entry_node,
                g_free(right);
                _SET(set, _CLOCK_DESCRIPTION_SET);
        } else if (!strcmp(left, "freq")) {
-               uint64_t freq;
+               uint64_t freq = -1ULL;
 
                if (_IS_SET(set, _CLOCK_FREQ_SET)) {
                        _BT_LOGE_DUP_ATTR(entry_node, "freq", "clock class");
This page took 0.024416 seconds and 4 git commands to generate.