#!/bin/sh

# --bufferoverrun \
# --pulse \

read -r -d '' SCRIPT <<'EOF'
infer \
  --report-console-limit 100 \
  --jobs 8 \
  --biabduction \
  --loop-hoisting \
  --quandary \
  --racerd \
  --starvation \
  --uninit \
  -- clang++ -fsyntax-only \
  $(pkg-config --cflags libconfig libsodium opus vpx) \
  /work/other/bootstrap_daemon/src/*.c \
  /work/other/bootstrap_node_packets.c \
  /work/toxav/*.c \
  /work/toxcore/*.c \
  /work/toxencryptsave/*.c
EOF

docker run --rm -it -v "$PWD:/work" toxchat/infer bash -c "$SCRIPT"
