Giter Site home page Giter Site logo

error parsing std libraries about c-for-go HOT 10 OPEN

xlab avatar xlab commented on July 17, 2024 1
error parsing std libraries

from c-for-go.

Comments (10)

xlab avatar xlab commented on July 17, 2024

Just for note: generates fine with default Apple LLVM, I do not use --ccincl (see Makefile)

$ clang -v
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

@terinjokes could you please post snippets or the whole file somewhere? Also please try -ccdefs and -ccincl flags (in different combinations):

c-for-go vorbis.yml
c-for-go --ccincl vorbis.yml
c-for-go --ccdefs vorbis.yml
c-for-go --ccincl --ccdefs vorbis.yml

from c-for-go.

terinjokes avatar terinjokes commented on July 17, 2024

c-for-go vorbis.yml

processing vorbis.yml ⠋[ERR] /data/data/com.termux/files/usr/include/stdint.h:33:10: include file not found: stddef.h. Search paths:
        /usr/include
        /data/data/com.termux/files/usr/include
        /data/data/com.termux/files/home/go/src/github.com/xlab/vorbis-go
        /usr/include
        /data/data/com.termux/files/usr/include
        /data/data/com.termux/files/home/go/src/github.com/xlab/vorbis-go (and 3 more errors)

--ccincl

included above

--ccdefs

processing vorbis.yml ⠹[ERR] /data/data/com.termux/files/usr/include/inttypes.h:268:33: unexpected '*', expected one of ['(', ')', ',', ':', ';', '=', '[', '{', _Bool, _Complex, _Noreturn, _Static_assert, asm, auto, char, const, double, enum, extern, float, inline, int, long, register, restrict, short, signed, static, struct, typedef, typedefname, typeof, union, unsigned, void, volatile] (and 3 more errors)

--ccincl --ccdefs

processing vorbis.yml ⠹/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:34:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:34:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:48:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:48:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:59:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:59:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:71:29: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:70:5: not a constant expression
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:84:6: called object is not a function or function pointer (have 'int')
/data/data/com.termux/files/usr/lib/clang/6.0.0/include/stddef.h:84:5: not a constant expression
too many errors

stddef.h

stddef.h hasn't changed in a number of years, and my version is a byte-for-byte match with master.

from c-for-go.

xlab avatar xlab commented on July 17, 2024
include file not found: stddef.h. Search paths:
        /usr/include

On my machine, that file is available at:

/usr/include/stddef.h
/*
 * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
 *
 * @APPLE_LICENSE_HEADER_START@
 * 

Will check out your stddef..

from c-for-go.

jclc avatar jclc commented on July 17, 2024

Hey, just wanted to point out that on my system stddef.h is not located in /usr/include either. It's dependent on the compiler in question, so for me it's located under /usr/lib/gcc/x86_64-pc-linux-gnu//include, so I had to manually add that to the include paths. Apple's Clang probably assumes that it is the only compiler installed on the system and places its stddef.h in /usr/include.

from c-for-go.

Noofbiz avatar Noofbiz commented on July 17, 2024

Hello! Trying to make a change to the vulkan-go manifest and getting this issue when I try to rebuild. I'm using Mojave 10.14.2. Clang gives me:

$ clang -v
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

c-for-go -ccdefs -out .. vulkan.yml

  processing vulkan.yml ⠹[ERR] vulkan/vk_platform.h:71:10: include file not found: stddef.h. Search paths:
	/usr/include
	/Users/noofapple/go/src/github.com/vulkan-go/vulkan
	/usr/include
	/Users/noofapple/go/src/github.com/vulkan-go/vulkan (and 2 more errors)
make: *** [all] Error 1

c-for-go -ccdefs -ccincl -out .. vulkan.yml

  processing vulkan.yml ⠙/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:34:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:34:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:48:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:48:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:59:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:59:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:71:29: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:70:5: not a constant expression
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:84:6: called object is not a function or function pointer (have 'int')
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/10.0.0/include/stddef.h:84:5: not a constant expression
too many errors
make: *** [all] Error 1

from c-for-go.

Noofbiz avatar Noofbiz commented on July 17, 2024

The issue seems to be coming from the __has_feature(modules) macro for Clang. Is your stddef.h the Clang or GCC version?

ETA: Mine seems to be a copy of the one linked above. With the copyright (c) 2008 Eli Friedman header.

from c-for-go.

RobinWragg avatar RobinWragg commented on July 17, 2024

I have exactly the same problem as @Noofbiz on Mojave 10.14.6, and I don't have /usr/include/stddef.h.

from c-for-go.

xlab avatar xlab commented on July 17, 2024

@RobinWragg I believe nobody has now, Catalina nuked /usr/include and there was some investigation in progress how to parse XCode internal includes that may contain weird macros:
#84

You may try something like

PARSER: 
  IncludePaths: [
    "/usr/include",
    "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
  ]

from c-for-go.

RobinWragg avatar RobinWragg commented on July 17, 2024

@xlab thanks for the suggestion. After I added the full include path, I get the same errors as @terinjokes at the top of this thread, i.e. issues with parsing stddef.h.

from c-for-go.

audiolion avatar audiolion commented on July 17, 2024

@xlab I am also getting similar errors as stated above after including /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

image

sys/socket.h:722
image

from c-for-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.