Skip to content

Commit

Permalink
common: helper to suppress 'may be used uninitialized' warnings.
Browse files Browse the repository at this point in the history
When gcc still warns at -O3 and you are sure it's not necessary,
this marks it appropriately.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Aug 2, 2019
1 parent df298ba commit 7835a25
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions common/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,9 @@ STRUCTEQ_DEF(sha256, 0, u);
/* Define ripemd160_eq. */
STRUCTEQ_DEF(ripemd160, 0, u);

/* If gcc complains about 'may be uninitialized' even at -O3, and the code is
* clear, use this to suppress it. Argument should be gcc version it
* complained on, so we can re-test as gcc evolves. */
#define COMPILER_WANTS_INIT(compiler_versions) = 0

#endif /* LIGHTNING_COMMON_UTILS_H */

0 comments on commit 7835a25

Please sign in to comment.