mrc-ide / heartbeatr

:heartpulse::computer::heartpulse: Redis heartbeat support
https://mrc-ide.github.io/heartbeatr
Other
2 stars 1 forks source link

Make C++ safe #12

Open richfitz opened 3 years ago

richfitz commented 3 years ago

There are a couple of issues here:

In file included from /usr/include/hiredis/hiredis.h:40,
                 from heartbeat.h:8,
                 from thread.h:4,
                 from thread.cpp:1:
/usr/include/hiredis/sds.h:48:10: warning: ISO C++ forbids flexible array member ‘buf’ [-Wpedantic]
   48 |     char buf[];
      |          ^~~
/usr/include/hiredis/sds.h:54:10: warning: ISO C++ forbids flexible array member ‘buf’ [-Wpedantic]
   54 |     char buf[];
      |          ^~~
/usr/include/hiredis/sds.h:60:10: warning: ISO C++ forbids flexible array member ‘buf’ [-Wpedantic]
   60 |     char buf[];
      |          ^~~
/usr/include/hiredis/sds.h:66:10: warning: ISO C++ forbids flexible array member ‘buf’ [-Wpedantic]
   66 |     char buf[];
      |          ^~~
/usr/include/hiredis/sds.h:72:10: warning: ISO C++ forbids flexible array member ‘buf’ [-Wpedantic]
   72 |     char buf[];
      |          ^~~

This would be eliminated by using C everywhere, which might involve moving to use https://tinycthread.github.io/ for the threading.