Frameworks/Security.framework/Headers/Authorization.h cannot be built against with GCC (syntax error)

Originator:samjd1024
Number:rdar://FB8919799 Date Originated:2017-12-27
Status:Open Resolved:
Product:macOS SDK Product Version:10.15, 10.16
Classification: Reproducible:
 
GCC is unable to build anything against Authorization.h because while Clang won’t compile with a static const for the char length, it cannot.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93082 for more information, also https://bugs.llvm.org/show_bug.cgi?id=44406.

Bad line: static const size_t kAuthorizationExternalFormLength = 32;
Fixed line: enum { kAuthorizationExternalFormLength = 32; }

Output (plenty of other examples of this problem online too):
In file included from /Users/sam/Gentoo/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/AuthSession.h:32,
                 from /Users/sam/Gentoo/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Security.h:42,
                 from git-credential-osxkeychain.c:4:
/Users/sam/Gentoo/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/Authorization.h:193:7: error: variably modified ‘bytes’ at file scope
  193 |  char bytes[kAuthorizationExternalFormLength];
      |       ^~~~~

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!