stan-dev / stan-dev/math

tbb/area.cpp triggers clang compiler warning unused-but-set-variable (mac-osx)

Open
#2,918 0 comments 0 reactions 1 assignee View on GitHub

@mitzimorris is already working on this.

Since Jun 28, 2023.

build
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

Building lib/tbb/libtbb.dylib results in one warning; adding option -Wno-unused-but-set-variable to make/libraries will fix.

Example

>  make lib/tbb/libtbb.dylib

... 
clang++ -o arena.o -c -MMD -O2 -DUSE_PTHREAD -DDO_ITT_NOTIFY -stdlib=libc++ -m64 -mrtm -mmacosx-version-min=10.11  -fPIC  -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -Wno-dangling-else -Wno-unknown-warning-option -Wno-deprecated-copy   -DTBB_SUPPRESS_DEPRECATED_MESSAGES=1 -std=c++1y  -I../tbb_2020.3/src -I../tbb_2020.3/src/rml/include -I../tbb_2020.3/include ../tbb_2020.3/src/tbb/arena.cpp
../tbb_2020.3/src/tbb/arena.cpp:308:14: warning: variable 'drained' set but not used [-Wunused-but-set-variable]
    intptr_t drained = 0;
             ^
1 warning generated.

....

Expected Output

All libraries should build without warnings; although this is just a warning, it's confusing to CmdStan and CmdStanX users.

Current Version:

v4.6.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.