Skip to content

Commit e3a790c

Browse files
authored
Fix compile time error in SparseData.h (#566)
In some platforms, it would error out like: In file included from SparseData.c:21: In function ‘compword_to_int8’, inlined from ‘sdata_to_float8arr’ at SparseData.c:248:14: SparseData.h:291:16: error: ‘num’ may be used uninitialized [-Werror=maybe-uninitialized] 291 | return num; | ^~~ SparseData.c: In function ‘sdata_to_float8arr’: SparseData.h:255:15: note: ‘num’ declared here 255 | int64 num; | ^~~ In function ‘compword_to_int8’, inlined from ‘sdata_index_to_int64arr’ at SparseData.c:274:17: SparseData.h:291:16: error: ‘num’ may be used uninitialized [-Werror=maybe-uninitialized] 291 | return num; | ^~~ SparseData.c: In function ‘sdata_index_to_int64arr’: SparseData.h:255:15: note: ‘num’ declared here 255 | int64 num; | ^~~ cc1: all warnings being treated as errors
1 parent c98d6c4 commit e3a790c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

gpcontrib/gp_sparse_vector/SparseData.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,8 @@ static inline int64 compword_to_int8(const char *entry)
284284
numptr8[6] = entry[7];
285285
numptr8[7] = entry[8];
286286
break;
287+
default:
288+
abort();
287289
}
288290

289291
return num;

0 commit comments

Comments
 (0)