jessevdk / cldoc

clang based documentation generator for C and C++
GNU General Public License v2.0
553 stars 59 forks source link

Errors when including <cstdint> #122

Closed emlai closed 6 years ago

emlai commented 7 years ago

I'm using cldoc 1.9 installed via sudo pip install cldoc. I'm invoking cldoc generate -- --output docs main.cpp which gives me the following output:

Processing main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:153:8: error: no member named 'int8_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:154:8: error: no member named 'int16_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:155:8: error: no member named 'int32_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:156:8: error: no member named 'int64_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:158:8: error: no member named 'uint8_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:159:8: error: no member named 'uint16_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:160:8: error: no member named 'uint32_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:161:8: error: no member named 'uint64_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:163:8: error: no member named 'int_least8_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:164:8: error: no member named 'int_least16_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:165:8: error: no member named 'int_least32_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:166:8: error: no member named 'int_least64_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:168:8: error: no member named 'uint_least8_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:169:8: error: no member named 'uint_least16_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:170:8: error: no member named 'uint_least32_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:171:8: error: no member named 'uint_least64_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:173:8: error: no member named 'int_fast8_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:174:8: error: no member named 'int_fast16_t' in the global namespace
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstdint:175:8: error: no member named 'int_fast32_t' in the global namespace
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Could not generate documentation due to parser errors

The file main.cpp has the following contents:

#include <cstdint>
int main() {}

I also tried cldoc -std=c++11 generate -- --output docs main.cpp with no luck.

This seems to be the same error as in #89, but apparently it's come back.

jessevdk commented 6 years ago

Seems fine for me on macOS. Do you still encounter this problem?

emlai commented 6 years ago

Apparently I had two clangs installed in different locations, one of them was clang 4.0 built from source, and the other was a newer one that comes with Xcode. I now removed the clang 4.0, and it seems to have fixed this problem.