You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
brew gist-logs <formula> link OR brew config AND brew doctor output
$ brew gist-logs spdlog
Error: No logs.
$ brew config
HOMEBREW_VERSION: 3.3.2
ORIGIN: https://github.com/Homebrew/brew
HEAD: 9daf5e2d28396c7a4379605e89e029d9fccb41e6
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: ff99cddaad3c870dac74d7be6b8da4bdbc2bce18
Core tap last commit: 56 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_EDITOR: nvim
HOMEBREW_MAKE_JOBS: 8
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: octa-core 64-bit arm_firestorm_icestorm
Clang: 13.0.0 build 1300
Git: 2.30.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.0.1-arm64
CLT: 13.1.0.0.1.1633545042
Xcode: 13.1
Rosetta 2: false
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!Warning: You have installed Bitdefender. The "Traffic Scan" option interferes withHomebrew's ability to download packages. See:
https://github.com/Homebrew/brew/issues/5558
I can't disable Bitdefender because this is a work machine. But I'm very confident that the issue isn't related to Bitdefender, since Homebrew's ability to download packages doesn't seem affected at all.
I ran brew update and am still able to reproduce my issue.
I have resolved all warnings from brew doctor and that did not fix my problem.
What were you trying to do (and why)?
I was using the spdlog package in a program.
What happened (include all command output)?
The pkgconfig file for spdlog specifies a cflags field which contains -DSPDLOG_FMT_EXTERNAL. The file spdlog/1.9.2/include/spdlog/tweakme.h (included by the main spdlog.h) also contains #define SPDLOG_FMT_EXTERNAL (not guarded by an #ifdef). So if you install the brew package for spdlog, then #include <spdlog/spdlog.h>, and compile the file using the flags suggested by pkg-config, the compiler complains that SPDLOG_FMT_EXTERNAL is being redefined.
$ cat test.cc
#include <spdlog/spdlog.h>
$ clang -c $(pkg-config --cflags spdlog) test.cc
In file included from test.cc:1:
In file included from /opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/spdlog.h:12:
In file included from /opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/common.h:6:
/opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/tweakme.h:74:9: warning: 'SPDLOG_FMT_EXTERNAL' macro r
edefined [-Wmacro-redefined]
#define SPDLOG_FMT_EXTERNAL
^
<command line>:3:9: note: previous definition is here
#define SPDLOG_FMT_EXTERNAL 1
^
1 warning generated.
What did you expect to happen?
I expected to be able to compile the source file without warnings with the compilation options suggested by the package's pkgconfig file.
$ brew install spdlog
$ echo'#include <spdlog/spdlog.h>'> test.cc
$ clang -c $(pkg-config --cflags spdlog) test.cc
In file included from test.cc:1:
In file included from /opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/spdlog.h:12:
In file included from /opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/common.h:6:
/opt/homebrew/Cellar/spdlog/1.9.2/include/spdlog/tweakme.h:74:9: warning: 'SPDLOG_FMT_EXTERNAL' macro r
edefined [-Wmacro-redefined]
#define SPDLOG_FMT_EXTERNAL
^
<command line>:3:9: note: previous definition is here
#define SPDLOG_FMT_EXTERNAL 1
^
1 warning generated.
The text was updated successfully, but these errors were encountered:
It's not causing any issues other than the warning, no. But the existence of a warning I can't do anything to fix is a real issue in itself, since generally you want to develop with -Werror or at the very least keep the build warning-free while developing, so it's a fairly significant inconvenience.
My workaround currently is to add -USPDLOG_FMT_EXTERNAL to the compiler flags when compiling under macOS, which works well until the issue is fixed.
I agree that there's a lot of abuse of -Werror out there, I've argued against it a lot and even submitted issues about -Werror causing build failures. However, I do think it has a place in one particular context: CI. My preferred way of developing software would be to avoid compiler warnings while developing locally, and then have a CI setup which compiles with -Werror to ensure nothing with warnings gets in.
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputI can't disable Bitdefender because this is a work machine. But I'm very confident that the issue isn't related to Bitdefender, since Homebrew's ability to download packages doesn't seem affected at all.
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
I was using the spdlog package in a program.
What happened (include all command output)?
The pkgconfig file for spdlog specifies a
cflags
field which contains-DSPDLOG_FMT_EXTERNAL
. The filespdlog/1.9.2/include/spdlog/tweakme.h
(included by the mainspdlog.h
) also contains#define SPDLOG_FMT_EXTERNAL
(not guarded by an#ifdef
). So if you install the brew package for spdlog, then#include <spdlog/spdlog.h>
, and compile the file using the flags suggested by pkg-config, the compiler complains that SPDLOG_FMT_EXTERNAL is being redefined.What did you expect to happen?
I expected to be able to compile the source file without warnings with the compilation options suggested by the package's pkgconfig file.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: