Skip to content

Recent commit breaks build #2268

@mxtommy

Description

@mxtommy

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

Configuration

Operating system: Windows
PlatformIO Version (platformio --version): 3.6.6

Description of problem

Commit d9e6111 lines 164-170 in platformio/builder/tools/piomisc.py removes already declared prototypes. However if there are no prototypes left in list, line 173 which references a specific index (0), causes build to fail with

IndexError: list index out of range

If I comment out the new lines (164-170 of piomisc.py) project compiles fine.

Steps to Reproduce

  1. Have .ino file
  2. Forward declare all functions
  3. Profit? :)

Actual Results

Build fails converting the ino to cpp

Expected Results

It should work :)

Source file to reproduce issue:

void setup();
void loop();

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

NOTE, must be Ino file, not cpp :)

Additional info

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions