Skip to content

avr-gcc -mmcu command is omitted. -MF arg should be stripped #3204

@patrykbajos

Description

@patrykbajos

Type: LanguageService

Describe the bug

  • OS and Version: Linux x64 4.14
  • VS Code Version: 1.31.1
  • C/C++ Extension Version: 0.21.0
  • Other extensions you installed (and if the issue persists after disabling them): vector-of-bool.cmake-tools, cheshirekow.cmake-format, platformio.platformio-ide
  • A clear and concise description of what the bug is.

Processor specific command -mmcu=atmegaXX is not recognized properly.
https://www.microchip.com/webdoc/AVRLibcReferenceManual/using_tools_1using_avr_gcc_mach_opt.html
None of these macros are not present in IntelliSense.

To Reproduce

  1. Make compile_commands.json for example:
[
    {
        "arguments": {
            "/usr/bin/avr-gcc",
            "-mmcu=atmega16",
            "-DF_CPU=1000000",
            "-c",
            "-o",
            ".../build/main.o",
            ".../src/main.c",
         },
        "directory": ".../src",
        "file": ".../src/main.c"
    }
]
  1. Add it to your configuration compileCommands.
  2. Try to check IntelliSense in any of files contined in your compileCommands..
  3. F_CPU macro is recognized, hardware specific macros are not.

Expected behavior

I expect to have hardware specific defines such as __AVR_ATmega16__.
I expect to have properly recognized avr/io.h header. It is not because lack of define __AVR_ATmega16__.

Screenshots

Additional context

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions