2

I'm seeing all kinds of errors and warnings when compiling software after a minor OSX upgrade from 12.1 to 12.2.1.

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:411:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'signbit' in the global namespace
using ::signbit;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:323:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
using ::isfinite;

In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/unordered_map:411:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__hash_table:18:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isless' in the global namespace
using ::isless;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:330:9: error: no member named 'islessequal' in the global namespace
using ::islessequal;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:331:9: error: no member named 'islessgreater' in the global namespace
using ::islessgreater;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:332:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;
      ~~^
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cmath:333:9: error: no member named 'isunordered' in the global namespace
using ::isunordered;

Another set of errors related to the upgrade are a bunch of these:

/usr/local/include/stdlib.h:355:21: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
         strtoq(const char *__str, char **__endptr, int __base);
                           ^
/usr/local/include/stdlib.h:355:21: note: insert '_Nullable' if the pointer may be null
         strtoq(const char *__str, char **__endptr, int __base);
                           ^
                             _Nullable 
/usr/local/include/stdlib.h:355:21: note: insert '_Nonnull' if the pointer should never be null
         strtoq(const char *__str, char **__endptr, int __base);

I've seen a lot of posts related to this, and I've tried the following:

  1. I wasn't using Xcode to begin with, but I tried downloading it anyway to see if it might help. It didn't.
  2. Deleted and reinstalled CommandLineTools multiple times
  3. Found an older version of the SDK and tried replacing the current SDKs with it (namely MaxOSX11.1.sdk) as 11.3, 12.x aren't working either.
xcrun --show-sdk-path                  
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

ls -l /Library/Developer/CommandLineTools/SDKs
total 0
lrwxr-xr-x  1 root  wheel   14 Feb 20 13:26 MacOSX.sdk -> MacOSX12.1.sdk
drwxr-xr-x  7 root  wheel  224 Feb 20 13:26 MacOSX11.3.sdk/
lrwxr-xr-x  1 root  wheel   14 Feb 20 13:25 MacOSX11.sdk -> MacOSX11.3.sdk
drwxr-xr-x  7 root  wheel  224 Feb 20 13:27 MacOSX12.1.sdk/
lrwxr-xr-x  1 root  wheel   14 Feb 20 13:25 MacOSX12.sdk -> MacOSX12.1.sdk
  1. Ran xcode-select -s /Library/Developer/CommandLineTools multiple times
  2. Tried creating manual sym links to make /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk point to the different SDKs on my system with no luck.

I'm out of ideas (short of hard resetting my mac, which I'd like to avoid).

Here is some hopefully helpful information:

clang -cc1 version 13.1.6 (clang-1316.0.20.6) default target x86_64-apple-darwin21.3.0
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /Library/Developer/CommandLineTools/usr/lib/clang/13.1.6/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
 /Library/Developer/CommandLineTools/usr/include
 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.

Everything I have is backed up to github but I'd really like to avoid a hard reset.

Sonny Parlin
  • 931
  • 2
  • 13
  • 28

1 Answers1

0

So after more digging, I ended up renaming some of the std library h files that were being referenced in /usr/local/include and my project is back to working.

Renamed the following files:

/usr/local/include/_stdio.h -> /usr/local/include/__stdio.h
/usr/local/include/stdio.h -> /usr/local/include/stdio_old.h
/usr/local/include/AvailabilityMacros.h -> /usr/local/include/_AvailabilityMacros.h
/usr/local/include/stdlib.h -> /usr/local/include/_stdlib.h
/usr/local/include/pthread.h -> /usr/local/include/_pthread.h

After hiding these files, the compiler is searching another directory with working headers and the project is compiling again without issue.

Sonny Parlin
  • 931
  • 2
  • 13
  • 28
  • The directory `/usr/local/` is not used by macOS directly. I guess you have Homebrew installed and some package (Clang?) is conflicting with the system headers. – prapin Feb 20 '22 at 20:52
  • Yes I have homebrew and yes, I believe clang was conflicting. – Sonny Parlin Feb 22 '22 at 21:15