microsoft / microsoft/vscode-cpptools

Compiler query should handle GCC-like compilers that support C but not C++ (i.e. Microchip's XC16)

Open
#7,534 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature Request Feature: Configuration Feature: IntelliSense Mode Language Service
Dominant language
TypeScript
Stars
6.2k
Forks
1.7k
Avg merge
14h 46m
Merged PRs (30d)
61

Description

Bug type: Language Service

Describe the bug

  • OS and Version: Debian GNU/Linux 10 (buster)
  • VS Code Version: 1.56.1
  • C/C++ Extension Version: 1.3.1
  • Other extensions you installed (and if the issue persists after disabling them): CMake Tools 1.7.3
  • If using SSH remote, specify OS of remote machine: none

System include path can't be pulled from Microchip's XC16 compiler.

I have a PIC24 MCU project which uses CMake and worked well in CLion.

When I open the project in VSCode, it can be correctly built by clicking on the Build button. However, all #include <xc.h> lines are red underlined.

The compiler path is already set in CMakeLists.txt. I tried to mess with compilerPath and includePath in c_cpp_properties.json, and none of them worked.

The XC16 is a modified GCC and its usages are exactly same as GCC.

Steps to reproduce

  1. Change compilerPath in c_cpp_properties.json to /opt/microchip/xc16/v1.70/bin/xc16-gcc
  2. Nothing changed. All #include <xc.h> lines are still red underlined.
  3. Add /opt/microchip/xc16/v1.70/support/** (which contains the xc.h file) to includePath in c_cpp_properties.json
  4. Nothing changed as well. All #include <xc.h> lines are still red underlined.
  5. Run C/C++: Log Diagnostics, and there are no lines begin with /opt/microchip/xc16/v1.70/support/.

Expected behavior
There shouldn't be any red underlines in code.

Code sample and logs

  • Code sample
#include <xc.h>

int main(){
  while (1) {
    LATFbits.LATF1 = !LATFbits.LATF1; // Blink a LED
  }
}
  • CMakeLists part of setting the compiler
if (XC16_TARGET_CPU)
    message("-- FindXC16: CPU set to ${XC16_TARGET_CPU}")
    set(XC16_COMPILER_OPTIONS -mcpu=${XC16_TARGET_CPU})

    if (NOT XC16_DISABLE_DEFAULT_LINKER_SCRIPT)
        message("-- FindXC16: Using default linker script for device ${XC16_TARGET_CPU}")
        set(XC16_LINKER_OPTIONS --script=p${XC16_TARGET_CPU}.gld)
    else()
        message("-- FindXC16: Default linker script disabled")
    endif()
endif()

if (UNIX)
    if (APPLE)
        set(XC16_DEFAULT_SEARCH_PATH /Applications/microchip/xc16/)
    else()
        set(XC16_DEFAULT_SEARCH_PATH /opt/microchip/xc16/)
    endif()
endif()

if (WIN32)
    set(XC16_DEFAULT_SEARCH_PATH "D:/Microchip/xc16/")
endif()

if (NOT XC16_SEARCH_PATH)
    message("-- FindXC16: Variable XC16_SEARCH_PATH isn't defined, default to ${XC16_DEFAULT_SEARCH_PATH}")
    set(XC16_SEARCH_PATH ${XC16_DEFAULT_SEARCH_PATH})
endif()

set(CMAKE_C_LINK_FLAGS "")

file(GLOB_RECURSE XC16_C_COMPILER ${XC16_SEARCH_PATH}/xc16-gcc)
if (XC16_C_COMPILER)
    message("-- FindXC16: Found xc16-gcc at ${XC16_C_COMPILER}")
    set(CMAKE_C_COMPILER    ${XC16_C_COMPILER})
    set(CMAKE_ASM_COMPILER  ${XC16_C_COMPILER})
endif()

file(GLOB_RECURSE XC16_CXX_COMPILER ${XC16_SEARCH_PATH}/xc16-g++)
if (XC16_CXX_COMPILER)
    message("-- FindXC16: Found xc16-g++ at ${XC16_CXX_COMPILER}")
    set(CMAKE_CXX_COMPILER ${XC16_CXX_COMPILER})
else()
    message("-- FindXC16: xc16-g++ not found, C++ support disabled")
endif()

file(GLOB_RECURSE XC16_AR ${XC16_SEARCH_PATH}/xc16-ar)
if (XC16_AR)
    message("-- FindXC16: Found xc16-ar at ${XC16_AR}")
    set(CMAKE_AR ${XC16_AR})
endif()

file(GLOB_RECURSE XC16_OBJCOPY ${XC16_SEARCH_PATH}/xc16-objcopy)
if (XC16_OBJCOPY)
    message("-- FindXC16: Found xc16-objcopy at ${XC16_OBJCOPY}")
    set(CMAKE_OBJCOPY ${XC16_OBJCOPY})
endif()

file(GLOB_RECURSE XC16_OBJDUMP ${XC16_SEARCH_PATH}/xc16-objdump)
if (XC16_OBJDUMP)
    message("-- FindXC16: Found xc16-objdump at ${XC16_OBJDUMP}")
    set(CMAKE_OBJDUMP ${XC16_OBJDUMP})
endif()

file(GLOB_RECURSE XC16_BIN2HEX ${XC16_SEARCH_PATH}/xc16-bin2hex)
if (XC16_BIN2HEX)
    message("-- FindXC16: Found xc16-bin2hex at ${XC16_BIN2HEX}")
    set(CMAKE_OBJDUMP ${XC16_BIN2HEX})
endif()

add_compile_options(${XC16_COMPILER_OPTIONS} -Wcast-align -omf=elf -DXPRJ_default=default -legacy-libc -msmart-io=1 -msfr-warn=off)

add_link_options(-Wl,--defsym=__MPLAB_BUILD=1,${XC16_LINKER_OPTIONS},--stack=16,--check-sections,--data-init,--pack-data,--handles,--isr,--no-gc-sections,--fill-upper=0,--stackguard=16,--no-force-link,--smart-io,--report-mem)

  • CMake output
[variant] Loaded new set of variants
[kit] Successfully loaded 8 kits from /root/.local/share/CMakeTools/cmake-tools-kits.json
[main] Configuring folder: PICo24_SDK 
[cmake] -- FindXC16: Variable XC16_SEARCH_PATH isn't defined, default to /opt/microchip/xc16/
[cmake] -- FindXC16: Found xc16-gcc at /opt/microchip/xc16//v1.70/bin/xc16-gcc
[cmake] -- FindXC16: Found xc16-g++ at /opt/microchip/xc16//v1.70/bin/xc16-g++
[cmake] -- FindXC16: Found xc16-ar at /opt/microchip/xc16//v1.70/bin/xc16-ar
[cmake] -- FindXC16: Found xc16-objcopy at /opt/microchip/xc16//v1.70/bin/xc16-objcopy
[cmake] -- FindXC16: Found xc16-objdump at /opt/microchip/xc16//v1.70/bin/xc16-objdump
[cmake] -- FindXC16: Found xc16-bin2hex at /opt/microchip/xc16//v1.70/bin/xc16-bin2hex
[cmake] -- PICo24: Using board: PotatoPi_PICo24, CPU: 24FJ256GB206
[cmake] Configuring done
[cmake] Generating done
  • Configurations in c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Linux",
            "includePath": [
                "/opt/microchip/xc16/v1.70/support/**",
                "${workspaceFolder}/**"
            ],
            "browse" :{
                "path": [
                    "/opt/microchip/xc16/v1.70/support/**",
                    "${workspaceFolder}/**"
                ]
            },
            "defines": [],
            "compilerPath": "/opt/microchip/xc16/v1.70/bin/xc16-gcc",
            "cStandard": "c99",
            "intelliSenseMode": "linux-gcc-x64",
            "configurationProvider": "ms-vscode.cmake-tools",
            "compileCommands": "${workspaceFolder}/build/compile_commands.json"
        }
    ],
    "version": 4
}
  • Logs from running C/C++: Log Diagnostics from the VS Code command palette
-------- Diagnostics - 5/17/2021, 7:43:23 PM
Version: 1.3.1
Current Configuration:
{
    "name": "Linux",
    "includePath": [
        "/opt/microchip/xc16/v1.70/support/**",
        "${workspaceFolder}/**"
    ],
    "browse": {
        "path": [
            "/opt/microchip/xc16/v1.70/support/**",
            "${workspaceFolder}/**"
        ],
        "limitSymbolsToIncludedHeaders": true
    },
    "defines": [],
    "compilerPath": "/opt/microchip/xc16/v1.70/bin/xc16-gcc",
    "cStandard": "c99",
    "intelliSenseMode": "linux-gcc-x64",
    "configurationProvider": "ms-vscode.cmake-tools",
    "compileCommands": "${workspaceFolder}/build/compile_commands.json",
    "compilerArgs": [],
    "intelliSenseModeIsExplicit": true,
    "cStandardIsExplicit": true,
    "cppStandardIsExplicit": true,
    "compilerPathIsExplicit": true
}
Custom browse configuration: 
{
    "browsePath": [
        "/root/Devel/PICo24_SDK/Boards/PotatoPi_PICo24",
        "/root/Devel/PICo24_SDK/Components",
        "/root/Devel/PICo24_SDK/Components/PICo24/Core",
        "/root/Devel/PICo24_SDK/Components/PICo24",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/EXT_INT",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/I2C",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/SPI",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/UART",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB/Device",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB/Host",
        "/root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB",
        "/root/Devel/PICo24_SDK/Components/PICo24/UnixAPI",
        "/root/Devel/PICo24_SDK"
    ],
    "standard": "gnu99",
    "compilerPath": "/opt/microchip/xc16/v1.70/bin/xc16-gcc",
    "compilerArgs": [
        "-fno-lto",
        "-fno-strict-aliasing",
        "-Wcast-align",
        "-omf=elf",
        "-DXPRJ_default=default",
        "-legacy-libc",
        "-msmart-io=1",
        "-msfr-warn=off",
        "-g",
        "-Os",
        "-std=gnu99",
        "-mcpu=\\\"24FJ256GB206\\\""
    ]
}
Custom configurations:
[ /root/Devel/PICo24_SDK/main.c ]
{
    "defines": [
        "XPRJ_default=default"
    ],
    "standard": "gnu99",
    "includePath": [
        "/root/Devel/PICo24_SDK/Boards/PotatoPi_PICo24",
        "/root/Devel/PICo24_SDK/Components"
    ],
    "compilerPath": "/opt/microchip/xc16/v1.70/bin/xc16-gcc",
    "compilerArgs": [
        "-fno-lto",
        "-fno-strict-aliasing",
        "-Wcast-align",
        "-omf=elf",
        "-DXPRJ_default=default",
        "-legacy-libc",
        "-msmart-io=1",
        "-msfr-warn=off",
        "-g",
        "-Os",
        "-std=gnu99",
        "-mcpu=\\\"24FJ256GB206\\\""
    ]
}
Translation Unit Mappings:
[ /root/Devel/PICo24_SDK/main.c ]:
    /root/Devel/PICo24_SDK/Components/PICo24/PICo24.h
Translation Unit Configurations:
[ /root/Devel/PICo24_SDK/main.c ]:
    Process ID: 4035
    Memory Usage: 20 MB
    Includes:
        /root/Devel/PICo24_SDK/Boards/PotatoPi_PICo24
        /root/Devel/PICo24_SDK/Components
        /usr/include/x86_64-linux-gnu/c++/8
        /usr/include/newlib/c++/7.3.1
        /usr/include/c++/8
        /usr/local/include
        /usr/lib/llvm-7/lib/clang/7.0.1/include
        /usr/include/x86_64-linux-gnu
        /usr/include/newlib
        /usr/include
    Defines:
        XPRJ_default=default
        XPRJ_default=default
    Standard Version: c99
    IntelliSense Mode: linux-gcc-x64
    Other Flags:
        --gcc
        --gnu_version=100000
Total Memory Usage: 20 MB
Browse Paths from compile_commands.json, from workspace folder: /root/Devel/PICo24_SDK
    /root/Devel/PICo24_SDK
    /root/Devel/PICo24_SDK/Boards/PotatoPi_PICo24
    /root/Devel/PICo24_SDK/Components
    /root/Devel/PICo24_SDK/Components/PICo24
    /root/Devel/PICo24_SDK/Components/PICo24/Core
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/EXT_INT
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/I2C
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/SPI
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/UART
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB/Device
    /root/Devel/PICo24_SDK/Components/PICo24/Peripherals/USB/Host
    /root/Devel/PICo24_SDK/Components/PICo24/UnixAPI

------- Workspace parsing diagnostics -------
Number of files discovered (not excluded): 49455


File exclude: **/.vscode
File exclude: **/.git
File exclude: **/.svn
File exclude: **/.hg
File exclude: **/CVS
File exclude: **/.DS_Store
Search exclude: **/node_modules
Search exclude: **/bower_components
Search exclude: **/*.code-search
Populate include completion cache.
Discovering files...
  Processing folder (recursive): /usr/local/include/
  Processing folder (recursive): /usr/lib/llvm-7/lib/clang/7.0.1/include/
  Processing folder (recursive): /usr/include/
  Processing folder (recursive): /root/Devel/PICo24_SDK/
  Discovering files: 49486 file(s) processed
  0 file(s) removed from database
Done discovering files.
Parsing open files...
Parsing remaining files...
  Parsing: 0 files(s) processed
Done parsing remaining files.
Done parsing open files.
idle loop: reparsing the active document
Checking for syntax errors: file:///root/Devel/PICo24_SDK/main.c
Queueing IntelliSense update for files in translation unit of: /root/Devel/PICo24_SDK/main.c
Error squiggle count: 66
Update IntelliSense time (sec): 0.254
terminating child process: 6746
terminating child process: 6748
Checking for syntax errors: file:///root/Devel/PICo24_SDK/Components/PICo24/PICo24.h
Queueing IntelliSense update for files in translation unit of: /root/Devel/PICo24_SDK/main.c
idle loop: reparsing the active document
Checking for syntax errors: file:///root/Devel/PICo24_SDK/Components/PICo24/PICo24.h
Queueing IntelliSense update for files in translation unit of: /root/Devel/PICo24_SDK/main.c
0 include path suggestion(s) discovered.
Error squiggle count: 65
Error squiggle count: 11
terminating child process: 6753
Update IntelliSense time (sec): 0.609
0 include path suggestion(s) discovered.
  • xc16-gcc preprocessor output:
➜  build git:(master) ✗ /opt/microchip/xc16/v1.70/bin/xc16-gcc -v -E -dD empty.c
Microchip Language Tool Shell Version 1.70 (Build date: Mar  2 2021).
Copyright (c) 2012-2017 Microchip Technology Inc. All rights reserved
Using built-in specs.
COLLECT_GCC=/opt/microchip/xc16/v1.70/bin/bin/elf-gcc
Target: pic30-elf
Configured with: /home/xc16/release-builds/build_20210302/src/XC_GCC/gcc/configure --build=x86_64-linux --target=pic30-elf --disable-lto --disable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --disable-hosted-libstdcxx --with-gnu-as --with-gnu-ld --enable-languages=c --disable-nls --disable-libgomp --without-headers --disable-libffi --disable-bootstrap --prefix=/bin --libexecdir=/bin --program-prefix=pic30- --with-libelf=/home/xc16/release-builds/build_20210302/bin/XC_GCC-elf-linux64-xclm/host-libs/ --with-dwarf2 --with-gmp=/home/xc16/release-builds/build_20210302/bin/XC_GCC-elf-linux64-xclm/host-libs --with-ppl=/home/xc16/release-builds/build_20210302/bin/XC_GCC-elf-linux64-xclm/host-libs --with-cloog=/home/xc16/release-builds/build_20210302/bin/XC_GCC-elf-linux64-xclm/host-libs --with-zlib=/home/xc16/release-builds/build_20210302/bin/XC_GCC-elf-linux64-xclm/host-libs --with-bugurl=https://www.microchip.com/technical-support --with-host-libstdcxx=
Thread model: single
gcc version 4.5.1 (XC16, Microchip v1.70) Build date: Mar  2 2021 (Microchip Technology) 
COLLECT_GCC_OPTIONS='-v' '-E' '-dD' '-mlegacy-libc'
 /opt/microchip/xc16/v1.70/bin/bin/../xc16-cc1 -E -quiet -v -iprefix /opt/microchip/xc16/v1.70/bin/bin/../pic30-elf/4.5.1/ empty.c -mresource=/opt/microchip/xc16/v1.70/bin/bin/../c30_device.info -omf=elf -mlegacy-libc -dD
Microchip Language Tool Shell Version 1.70 (Build date: Mar  2 2021).
Copyright (c) 2012-2017 Microchip Technology Inc. All rights reserved
ignoring nonexistent directory "/opt/microchip/xc16/v1.70/bin/bin/../pic30-elf/4.5.1/include"
ignoring nonexistent directory "/opt/microchip/xc16/v1.70/bin/bin/../pic30-elf/4.5.1/include-fixed"
ignoring nonexistent directory "/opt/microchip/xc16/v1.70/bin/bin/../pic30-elf/4.5.1/../../../../pic30-elf/sys-include"
ignoring nonexistent directory "/opt/microchip/xc16/v1.70/bin/bin/../pic30-elf/4.5.1/../../../../pic30-elf/include"
ignoring nonexistent directory "/root/Downloads/xc16_v1.70.src/v1.70.src/install-linux64/bin/lib/gcc/pic30-elf/4.5.1/include"
ignoring nonexistent directory "/root/Downloads/xc16_v1.70.src/v1.70.src/install-linux64/bin/lib/gcc/pic30-elf/4.5.1/include-fixed"
ignoring nonexistent directory "/root/Downloads/xc16_v1.70.src/v1.70.src/install-linux64/bin/pic30-elf/sys-include"
ignoring nonexistent directory "/root/Downloads/xc16_v1.70.src/v1.70.src/install-linux64/bin/pic30-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/microchip/xc16/v1.70/bin/bin/../../include/lega-c
 /opt/microchip/xc16/v1.70/bin/bin/../../support/generic/h
End of search list.
# 1 "empty.c"
# 1 "<built-in>"
#define __STDC__ 1
#define __STDC_HOSTED__ 1
#define __GNUC__ 4
#define __GNUC_MINOR__ 5
#define __GNUC_PATCHLEVEL__ 1
#define __SIZE_TYPE__ unsigned int
#define __PTRDIFF_TYPE__ int
#define __WCHAR_TYPE__ short unsigned int
#define __WINT_TYPE__ unsigned int
#define __INTMAX_TYPE__ long long int
#define __UINTMAX_TYPE__ long long unsigned int
#define __CHAR16_TYPE__ short unsigned int
#define __CHAR32_TYPE__ unsigned int
#define __GXX_ABI_VERSION 1002
#define __USING_SJLJ_EXCEPTIONS__ 1
#define __SCHAR_MAX__ 127
#define __SHRT_MAX__ 32767
#define __INT_MAX__ 32767
#define __LONG_MAX__ 2147483647L
#define __LONG_LONG_MAX__ 9223372036854775807LL
#define __WCHAR_MAX__ 65535U
#define __WCHAR_MIN__ 0U
#define __WINT_MAX__ 65535U
#define __WINT_MIN__ 0U
#define __PTRDIFF_MAX__ 32767
#define __SIZE_MAX__ 65535U
#define __CHAR_BIT__ 8
#define __INTMAX_MAX__ 9223372036854775807LL
#define __INTMAX_C(c) c ## LL
#define __UINTMAX_MAX__ 18446744073709551615ULL
#define __UINTMAX_C(c) c ## ULL
#define __FLT_EVAL_METHOD__ 0
#define __DEC_EVAL_METHOD__ 2
#define __FLT_RADIX__ 2
#define __FLT_MANT_DIG__ 24
#define __FLT_DIG__ 6
#define __FLT_MIN_EXP__ (-125)
#define __FLT_MIN_10_EXP__ (-37)
#define __FLT_MAX_EXP__ 128
#define __FLT_MAX_10_EXP__ 38
#define __FLT_MAX__ 3.4028234663852886e+38F
#define __FLT_MIN__ 1.1754943508222875e-38F
#define __FLT_EPSILON__ 1.1920928955078125e-7F
#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
#define __FLT_HAS_DENORM__ 1
#define __FLT_HAS_INFINITY__ 1
#define __FLT_HAS_QUIET_NAN__ 1
#define __DBL_MANT_DIG__ 24
#define __DBL_DIG__ 6
#define __DBL_MIN_EXP__ (-125)
#define __DBL_MIN_10_EXP__ (-37)
#define __DBL_MAX_EXP__ 128
#define __DBL_MAX_10_EXP__ 38
#define __DBL_MAX__ ((double)3.4028234663852886e+38L)
#define __DBL_MIN__ ((double)1.1754943508222875e-38L)
#define __DBL_EPSILON__ ((double)1.1920928955078125e-7L)
#define __DBL_DENORM_MIN__ ((double)1.4012984643248171e-45L)
#define __DBL_HAS_DENORM__ 1
#define __DBL_HAS_INFINITY__ 1
#define __DBL_HAS_QUIET_NAN__ 1
#define __LDBL_MANT_DIG__ 53
#define __LDBL_DIG__ 15
#define __LDBL_MIN_EXP__ (-1021)
#define __LDBL_MIN_10_EXP__ (-307)
#define __LDBL_MAX_EXP__ 1024
#define __LDBL_MAX_10_EXP__ 308
#define __DECIMAL_DIG__ 17
#define __LDBL_MAX__ 1.7976931348623157e+308L
#define __LDBL_MIN__ 2.2250738585072014e-308L
#define __LDBL_EPSILON__ 2.2204460492503131e-16L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
#define __LDBL_HAS_DENORM__ 1
#define __LDBL_HAS_INFINITY__ 1
#define __LDBL_HAS_QUIET_NAN__ 1
#define __DEC32_MANT_DIG__ 7
#define __DEC32_MIN_EXP__ (-94)
#define __DEC32_MAX_EXP__ 97
#define __DEC32_MIN__ 1E-95DF
#define __DEC32_MAX__ 9.999999E96DF
#define __DEC32_EPSILON__ 1E-6DF
#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
#define __DEC64_MANT_DIG__ 16
#define __DEC64_MIN_EXP__ (-382)
#define __DEC64_MAX_EXP__ 385
#define __DEC64_MIN__ 1E-383DD
#define __DEC64_MAX__ 9.999999999999999E384DD
#define __DEC64_EPSILON__ 1E-15DD
#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
#define __DEC128_MANT_DIG__ 34
#define __DEC128_MIN_EXP__ (-6142)
#define __DEC128_MAX_EXP__ 6145
#define __DEC128_MIN__ 1E-6143DL
#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
#define __DEC128_EPSILON__ 1E-33DL
#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
#define __REGISTER_PREFIX__ 
#define __USER_LABEL_PREFIX__ _
#define __VERSION__ "4.5.1 (XC16, Microchip v0_00) Build date: May  5 2021"
#define __GNUC_GNU_INLINE__ 1
#define __NO_INLINE__ 1
#define __FINITE_MATH_ONLY__ 0
#define __PRAGMA_REDEFINE_EXTNAME 1
#define __SIZEOF_INT__ 2
#define __SIZEOF_LONG__ 4
#define __SIZEOF_LONG_LONG__ 8
#define __SIZEOF_SHORT__ 2
#define __SIZEOF_FLOAT__ 4
#define __SIZEOF_DOUBLE__ 4
#define __SIZEOF_LONG_DOUBLE__ 8
#define __SIZEOF_SIZE_T__ 2
#define __SIZEOF_WCHAR_T__ 2
#define __SIZEOF_WINT_T__ 2
#define __SIZEOF_PTRDIFF_T__ 2
#define __SIZEOF_POINTER__ 2
#define __OPTIMIZATION_LEVEL__ 0
#define __LARGE_ARRAYS__ 0
#define __BUILTIN_ITTYPE 1
#define __C30_VERSION__ 0
#define __XC16_VERSION 0
#define __XC16_VERSION__ 0
#define __XC__ 1
#define __XC16 1
#define __C30 1
#define __dsPIC30 1
#define __C30__ 1
#define __XC16__ 1
#define __dsPIC30__ 1
#define __XC16ELF 1
#define __C30ELF 1
#define __dsPIC30ELF 1
#define __C30ELF__ 1
#define __XC16ELF__ 1
#define __dsPIC30ELF__ 1
#define C30 1
#define XC16 1
#define dsPIC30 1
#define __HAS_DSP__ 1
#define __BIGGEST_ALIGNMENT__ 2
# 1 "<command-line>"
# 1 "empty.c"
PIC30_COMPILER_PATH=/opt/microchip/xc16/v1.70/bin/bin/../
PIC30_LIBRARY_PATH=/opt/microchip/xc16/v1.70/bin/bin/../:/opt/microchip/xc16/v1.70/bin/bin/../../lib/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/PIC24E/:/opt/microchip/xc16/v1.70/bin/bin/../../support/PIC24E/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/PIC24F/:/opt/microchip/xc16/v1.70/bin/bin/../../support/PIC24F/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/PIC24H/:/opt/microchip/xc16/v1.70/bin/bin/../../support/PIC24H/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/dsPIC30F/:/opt/microchip/xc16/v1.70/bin/bin/../../support/dsPIC30F/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../support/dsPIC33C/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/dsPIC33E/:/opt/microchip/xc16/v1.70/bin/bin/../../support/dsPIC33E/gld/:/opt/microchip/xc16/v1.70/bin/bin/../../lib/dsPIC33F/:/opt/microchip/xc16/v1.70/bin/bin/../../support/dsPIC33F/gld/
COLLECT_GCC_OPTIONS='-v' '-E' '-dD' '-mlegacy-libc'

Screenshots

Screenshot_20210517_202459

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the XC16 compiler path and the sample CMake project, then run C/C++: Log Diagnostics to inspect the detected include paths. Compare the compiler-query behavior for a GCC-like compiler that supports C without C++; done means the XC16 support directory is detected and #include <xc.h> is no longer underlined.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, cmake
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.