c-for-go icon indicating copy to clipboard operation
c-for-go copied to clipboard

Parsing broken on Xcode Tools 11.2

Open xlab opened this issue 4 years ago • 2 comments

In latest Xcode releases and especially on macOS Catalina there is no more /usr/include dir. But with -ccincl it is possible to point c-for-go to the compile-suggested include directories.

However, latest Clang headers are failing to parse, example:

at /Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include/stdint.h:

/* If we're hosted, fall back to the system's stdint.h, which might have
 * additional definitions.
 */
#if __STDC_HOSTED__ && __has_include_next(<stdint.h>)

Error:

/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/include/stdint.h:31:43: unexpected '<', expected optional argument expression list or one of [&&, '!', '&', '(', ')', '*', '+', '-', '~', ++, --, _Alignof, character constant, floating-point constant, identifier, integer constant, long character constant, long string constant, sizeof, string literal] (and 1 more errors)

xlab avatar Dec 08 '19 18:12 xlab

This is affecting me right now on Big Sur, Macbook M1. Is there anything I can do to help get this moving?

wilkesreid avatar Mar 13 '21 00:03 wilkesreid

For me, adding Defines: _ANSI_SOURCE: 1

(in yml file) solves Xcode clang issues. (Additionally, stdbool.h and stdarg.h need to be created, but I think this is already mentioned in other issues).

lotodore avatar Aug 10 '22 20:08 lotodore