Skip to content

Commit d36ddaa

Browse files
[compiler-rt] Fix a warning
This patch fixes: compiler-rt/lib/builtins/int_to_fp_impl.inc:22:18: error: expression is not an integer constant expression; folding it to a constant is a GNU extension [-Werror,-Wgnu-folding-constant] by using enum for constants.
1 parent a3937c4 commit d36ddaa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

compiler-rt/lib/builtins/int_to_fp.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,19 @@ enum {
5353
typedef double dst_t;
5454
typedef uint64_t dst_rep_t;
5555
#define DST_REP_C UINT64_C
56-
static const int dstSigBits = 52;
56+
57+
enum {
58+
dstSigBits = 52,
59+
};
5760

5861
#elif defined DST_QUAD
5962
typedef long double dst_t;
6063
typedef __uint128_t dst_rep_t;
6164
#define DST_REP_C (__uint128_t)
62-
static const int dstSigBits = 112;
65+
66+
enum {
67+
dstSigBits = 112,
68+
};
6369

6470
#else
6571
#error Destination should be a handled floating point type

0 commit comments

Comments
 (0)