Feature suggestion: build_src_unflags

Open
#5,547 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@hariomkhonde108 is already working on this.

Since Nov 27, 2026.

  • #5549 by @hariomkhonde108 — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
build-system

Research direction

Start by reading how build__src_flags is handled and how build_unflags removes flags in PlatformIO Core; the issue does not name files or tests, so locate those entry points first. Check how source-specific flags are applied to files under build_src and what tests cover flag configuration. Done means build__src_unflags removes the requested flags from that source build while leaving other build flags intact.

Written by the indexing model from the issue text.

Description

Feature suggestion: build_src_unflags

Hello
For a project using PlatformIO, I am trying to configure my platformio.ini file so that I get compiler warnings for my own code in the build_src directory without getting all the warning caused by code from libraries/toolchains.

I would like to have a setup like:

[env]
build_flags=
                   -w ;Suppress all warnings

build__src_unflags=
                   -w ;Do not suppress all warnings

build__src_flags=
                   -Wall ;Show all warnings
                   -Werror ;Show warnings as errors

Is there a reason build__src_unflags= was not added together with the build__src_flags= ? Could this be added as a new feature?

Thanks in advance!
Greetings
Wout

Dominant language
Python
Stars
9.6k
Forks
916
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from platformio/platformio-core

All issues in platformio/platformio-core

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.