Stackdriver / collectd

Stackdriver's monitoring agent based on collectd (http://collectd.org).
https://cloud.google.com/monitoring/agent/
Other
51 stars 15 forks source link

Remove unreachable else clause. #160

Closed qingling128 closed 4 years ago

qingling128 commented 4 years ago

One side effect of this change is to avoid errors like:

src/aggregation.c: In function 'agg_instance_create_name':
src/aggregation.c:210:20: error: '%s' directive output may be truncated writing up to 112 bytes into a region of size between 15 and 127 [-Werror=format-truncation=]
                "%s-%s-%s", tmp_plugin, tmp_plugin_instance,
                    ^~                  ~~~~~~~~~~~~~~~~~~~
src/aggregation.c:209:7: note: 'snprintf' output between 17 and 241 bytes into a destination of size 128
       snprintf(inst->ident.plugin_instance, sizeof(inst->ident.plugin_instance),
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                "%s-%s-%s", tmp_plugin, tmp_plugin_instance,
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                AGG_FUNC_PLACEHOLDER);
                ~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[3]: *** [Makefile:6209: src/aggregation.lo] Error 1
StevenYCChou commented 4 years ago

Hi @qingling128 ,

As you are the creator of the PR, I added you as an assignee.

Let me know if you have any questions. Thanks!

qingling128 commented 4 years ago

This one is replaced by https://github.com/collectd/collectd/pull/3350 in the upstream.