Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
flow/form: add missing warning ignoring pragma section
Browse files Browse the repository at this point in the history
This will help clean warnings on our build. Those truncations are
intentional, as commented before.

Signed-off-by: Gustavo Lima Chaves <[email protected]>
  • Loading branch information
Gustavo Lima Chaves committed Jul 10, 2018
1 parent 2cb5f50 commit 5ca6d6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/modules/flow/form/form.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,11 +1140,13 @@ integer_custom_open(struct sol_flow_node *node,
mdata->blink_on = true;

/* outputs truncated on purpose -- only the return value matters */
#pragma GCC diagnostic ignored "-Wformat-truncation"
n_max = snprintf(sbuf, 1, "%+" PRId32 "", mdata->base.state.max);
SOL_INT_CHECK_GOTO(n_max, < 0, err);

n_min = snprintf(sbuf, 1, "%+" PRId32 "", mdata->base.state.min);
SOL_INT_CHECK_GOTO(n_min, < 0, err);
#pragma GCC diagnostic pop

/* -1 to take away sign */
mdata->n_digits = sol_util_max(n_min, n_max) - 1;
Expand Down

0 comments on commit 5ca6d6a

Please sign in to comment.