sewenew/redis-plus-plus

[BUG] Issues when compiling with GCC 13

LucasGasparinoBSC opened this issue · 2 comments

Describe the bug
Issues with C standard integers when compiling with GCC 13.2.1 (default on Arch). More specifically:

error: ‘uint16_t’ does not name a type
187 | uint16_t crc16(const char *buf, int len);
| ^~~~~~~~
/home/lucas/Apps/libraries/smartredis/0.4.0/nvhpc/SmartRedis/third-party/redis-plus-plus/src/sw/redis++/utils.h:24:1: note: ‘uint16_t’ is defined in header ‘’; did you forget to ‘#include ’?
23 | #include "cxx_utils.h"
+++ |+#include

This is fine with GCC < 13, but the header must be included if that compiler is to be supported.

To Reproduce
Simply running CMake with GCC 13 compilers should cause the build failure.

Expected behavior

Environment:

  • OS: Garuda Archlinux
  • Compiler: GCC 13.2.1
  • hiredis version: master
  • redis-plus-plus version: 1.3.5

Additional context
This is happening when I try to use the make deps script for building SmartRedis, which clones redis-plus-plus every time it's run. In any case, the suggested fix with <cstdint> ensures the correct header is used regardless of compiler version.

This problem has already been fixed with this PR.

Could you please update your redis-plus-plus to the latest version and have a try.

Regards

Thank you very much! I switched to 1.3.10 and it works perfectly. Closing as solved.