Skip to content

clang: include of non-modular header stdckdint.h inside framework module #166173

@torarnv

Description

@torarnv

In testing module maps in Qt:

83: Test command: /opt/homebrew/bin/cmake "-E" "env" "bash" "-c" "clang -x objective-c++ -std=c++17 -fmodules -fcxx-modules -fmodules-cache-path="/tmp/test_clang_header_map" -fsyntax-only -ferror-limit=0 -Xclang -fdiagnostics-absolute-paths -fdiagnostics-show-note-include-stack -Wnon-modular-include-in-module -Wnon-modular-include-in-framework-module -Wincomplete-umbrella -Wquoted-include-in-framework-header -Watimport-in-framework-header -Wframework-include-private-from-public -Wincomplete-framework-module-declaration -Wincomplete-module -Werror -fcolor-diagnostics -F"/Users/torarne/build/qt/6.x-modules/install/lib" -I"/Users/torarne/build/qt/6.x-modules/install/include" <(echo '@import QtCore;')"
83: Working Directory: /Users/torarne/build/qt/6.x-modules/tests/cmake/build_dir/test_clang_header_modules
83: Test timeout computed to be: 1500
83: While building module 'QtCore' imported from /dev/fd/63:1:
83: In file included from <module-includes>:1:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/QAbstractAnimation:1:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qabstractanimation.h:8:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qobject.h:10:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qobjectdefs.h:12:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qnamespace.h:12:
83: In file included from /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qglobal.h:60:
83: /Users/torarne/build/qt/6.x-modules/install/lib/QtCore.framework/Versions/A/Headers/qnumeric.h:33:14: error: include of non-modular header inside framework module 'QtCore': '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include/stdckdint.h' [-Werror,-Wnon-modular-include-in-framework-module]
83:    33 | #    include <stdckdint.h>
83:       |              ^
83: /dev/fd/63:1:9: fatal error: could not build module 'QtCore'
83:     1 | @import QtCore;
83:       |  ~~~~~~~^~~~~~
83: 2 errors generated.

The code in qnumeric.h:

#if __has_include(<stdckdint.h>)
// This was added by C23 and C++26, defining __STDC_VERSION_STDCKDINT_H__ when
// usable. Its provided functions are in the global namespace even in C++ (not
// std::) because they are sometimes macros.
#  include <QtCore/qstdlibdetection.h>
#  if defined(Q_CC_GNU_ONLY) && (defined(Q_STL_LIBCPP) || Q_CC_GNU_ONLY < 1500)
//   broken - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121811
#  elif defined(Q_OS_FREEBSD) && __FreeBSD_version <= 1500000
//   broken - https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290299
#  else
#    include <stdckdint.h>
#  endif
#endif

Shouldn't the <stdckdint.h> include automatically build and use the std module?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions