8000 cpptools doesn't parse qcc system include arguments from compile_commands.json · Issue #13567 · microsoft/vscode-cpptools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cpptools doesn't parse qcc system include arguments from compile_commands.json #13567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ABee81 opened this issue Apr 29, 2025 · 3 comments
Open
Labels
enhancement Improvement to an existing feature external Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service

Comments

@ABee81
Copy link
ABee81 commented Apr 29, 2025

Environment

  • OS and Version: Ubuntu 22.04.5 LTS
  • VS Code Version: 1.99.3
  • C/C++ Extension Version: 1.25.3
  • If using SSH remote, specify OS of remote machine: No remote

Bug Summary and Steps to Reproduce

Bug Summary:
For the following Test_Workspace:
Test_Workspace/

  • build/qnx710
    • compile_commands.json
    • ...
  • inc/
    • myInclude.h
  • cmake/
    • toolchains/
      • qnx710-arm-toolchain-conan.cmake
  • main.c
  • CMakeLists.txt
  • conanfile.py

After executing the build, CMake generates compile_commands.json file inside build/qnx710 folder. When adding compile_commands.json path to the c_cpp_properties.json configuration of the workspace, the system includes in with the format "-Wp,-isystem,/home//Test_Workspace/inc" are ignored/not parsed correctly by cpptools. Navigating to the header files in the system include folder is not working, error squiggles and the message:
#include errors detected. Consider updating your compile_commands.json or includePath. Squiggles are disabled for this translation unit (/home/Test_Workspace/main.c).C/C++(1696)

Steps to reproduce:

  1. Create a compile_commands.json which includes -Wp,-isystem,/home//Test_Workspace/inc
  2. Add path to this compile_commands.json to the c_cpp_properties.json
  3. Try CTRL+LeftMouseclick on an system include
  4. See error

Expected behavior:
cpptools parsed sytem include path correctly and navigating to the header files in the system include path works without errors. No error squiggles should be shown.

Configuration and Logs

{
    "configurations": [
        {
            "name": "neutrino_armv8_qcc83_debug",
            "compilerPath": "~/.conan/data/<path-to-toolchain-package>/host/linux/x86_64/usr/bin/qcc",
            "cStandard": "c11",
            "cppStandard": "c++14",
            "compileCommands": [
                "build/qnx710/compile_commands.json"
            ],
            "includePath": [
                "${workspaceFolder}/**"
            ]
        }
    ],
    "version": 4
}

-------- Diagnostics - 4/29/2025, 11:29:15 AM
Version: 1.25.3
Current Configuration:
{
    "name": "neutrino_armv8_qcc83_bbnxp_debug",
    "compilerPath": "/home/<username>/.conan/<path-to-toolchain-package>/host/linux/x86_64/usr/bin/qcc",
    "cStandard": "c11",
    "cppStandard": "c++14",
    "compileCommands": [
        "/home/<username>/Test_Workspace/build/qnx710/compile_commands.json"
    ],
    "includePath": [
        "/home/<username>/Test_Workspace/**"
    ],
    "compilerPathIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "intelliSenseModeIsExplicit": false,
    "recursiveIncludesReduceIsExplicit": true,
    "recursiveIncludesPriorityIsExplicit": true,
    "recursiveIncludesOrderIsExplicit": true,
    "compilerPathInCppPropertiesJson": "~/.conan/<path-to-toolchain-package>/host/linux/x86_64/usr/bin/qcc",
    "compileCommandsInCppPropertiesJson": [
        "build/qnx710/compile_commands.json"
    ],
    "mergeConfigurations": false,
    "recursiveIncludes": {
        "reduce": "default",
        "priority": "afterSystemIncludes",
        "order": "depthFirst"
    },
    "browse": {
        "limitSymbolsToIncludedHeaders": true
    }
}
Additional Tracked Settings:
{
    "editorTabSize": 4,
    "editorInsertSpaces": true,
    "editorAutoClosingBrackets": "languageDefined",
    "filesEncoding": "utf8",
    "filesAssociations": {
        "stdio.h": "c"
    },
    "filesExclude": {
        "**/.git": true,
        "**/.svn": true,
        "**/.hg": true,
        "**/.DS_Store": true,
        "**/Thumbs.db": true
    },
    "filesAutoSaveAfterDelay": false,
    "
8000
editorInlayHintsEnabled": true,
    "editorParameterHintsEnabled": true,
    "searchExclude": {
        "**/node_modules": true,
        "**/bower_components": true,
        "**/*.code-search": true
    },
    "workbenchSettingsEditor": "ui"
}
cpptools version (native): 1.25.3.0
Current database path: /home/<username>/.cache/vscode-cpptools/15cea5a343f9a039922a513837cff81f/.browse.VC.db
Translation Unit Mappings:
[ /home/<username>/Test_Workspace/main.c - source TU]:
Translation Unit Configurations:
[ /home/<username>/Test_Workspace/main.c ]
    Process ID: 17277
    Memory Usage: 20 MB
    Compiler Path: /home/<username>/.conan/<path-to-toolchain-package>/host/linux/x86_64/usr/bin/qcc
    Include paths:
        include: /home/<username>/Test_Workspace/build/qnx710/{USER_DEFINED}-L{USER_DEFINED}
        system include: /home/<username>/.conan/<additional-system-includes>/target/qnx7/usr/include
        system include: /home/<username>/.conan/<additional-system-includes>/host/linux/x86_64/usr/lib/gcc/aarch64-unknown-nto-qnx7.1.0/8.3.0/include
    Defines:
        _FORTIFY_SOURCE=2
        _QNX_SOURCE
        _DEBUG
    Standard Version: c11
    IntelliSense Mode: linux-gcc-arm64
    Other Flags:
        --gcc
        --gnu_version=80300
    compile_commands.json entry:
        directory: /home/<username>/Test_Workspace/build/qnx710
        file: /home/<username>/Test_Workspace/main.c
        command: /home/<username>/.conan/<path-to-toolchain-package>host/linux/x86_64/usr/bin/qcc  -Wp,-isystem,/home/<username>/Test_Workspace/inc -V,gcc_ntoaarch64le -fno-common -fno-builtin -fno-aggressive-loop-optimizations -fPIC -fPIE -D_FORTIFY_SOURCE=2 -fstack-protector-strong -std=c11 -D_QNX_SOURCE -I{USER_DEFINED}-L{USER_DEFINED} -ffunction-sections -fdata-sections -g -O2 -D_DEBUG -o CMakeFiles/hello-world.dir/main.c.o -c /home/<username>/Test_Workspace/main.c
Total Memory Usage: 20 MB
Browse Paths from compile_commands.json, from workspace folder: /home/<username>/Test_Workspace
    /home/<username>/.conan/<additional-system-includes>/host/linux/x86_64/usr/lib/gcc/aarch64-unknown-nto-qnx7.1.0/8.3.0/include
    /home/<username>/.conan/<additional-system-includes>/host/linux/x86_64/usr/lib/gcc/x86_64-pc-nto-qnx7.1.0/8.3.0/include
    /home/<username>/.conan/<additional-system-includes>/target/qnx7/usr/include
    /home/<username>/.conan/<additional-system-includes>/target/qnx7/usr/include/c++/v1
    /home/<username>/Test_Workspace
    /home/<username>/Test_Workspace/build/qnx710
    /home/<username>/Test_Workspace/build/qnx710/{USER_DEFINED}-L{USER_DEFINED}

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 2873
Number of files parsed: 217

Other Extensions

No response

Additional context

No response

@sean-mcmanus sean-mcmanus added Language Service Feature: Configuration An issue related to configuring the extension or IntelliSense enhancement Improvement to an existing feature labels Apr 29, 2025
@sean-mcmanus
Copy link
Contributor

@ABee81 We currently only support -isystem and not -Wp,-isystem (which I have never seen before).

@ABee81
Copy link
Author
ABee81 commented May 5, 2025

@sean-mcmanus Thanks for you quick answer! I also never saw it before, but In QNX SDP Documentation I could find some additional information: the -Wp argument of qcc passes the following arguments to the preprocessor.

If its possible it would be great to have this as a feature, up to then we will be using a script to replace -Wp,-isystem with just -isystem

@ABee81
Copy link
Author
ABee81 commented May 5, 2025

@sean-mcmanus after more deeper analysis into the issue I think it is not a cpptools issue. I have opened an issue for CMake (https://gitlab.kitware.com/cmake/cmake/-/issues/26912). Depending on response of Kitware/CMake, this feature might not be needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement to an existing feature external Feature: Configuration An issue related to configuring the extension or IntelliSense Language Service
Projects
Status: No status
Development

No branches or pull requests

2 participants
0