Skip to content

Fix warning about ignoring return value of asprintf #48

@alistairking

Description

@alistairking

(Ideally also replacing use of asprintf with snprintf)

tsk-proxy.c: In function ‘inc_stat’:
tsk-proxy.c:208:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
   asprintf(&stats_key, "%s.%s", stats_key_prefix, stats_key_suffix);
   ^
tsk-proxy.c: In function ‘init_kafka’:
tsk-proxy.c:380:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
   asprintf(&topic_name, "%s.%s", cfg->kafka_topic_prefix, cfg->kafka_channel);
   ^
tsk-proxy.c:381:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
   asprintf(&group_id, "%s.%s", cfg->kafka_consumer_group, topic_name);
   ^
tsk-proxy.c: In function ‘create_stats_prefix’:
tsk-proxy.c:580:3: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result [-Wunused-result]
   asprintf(&stats_key_prefix, "%s.%s.%s.%s", STATS_METRIC_PREFIX,
   ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions