From b4cc89f60ce174657cb41c517167a833e856225a Mon Sep 17 00:00:00 2001 From: virskl Date: Mon, 16 Nov 2026 16:20:02 +0100 Subject: [PATCH 1/2] IgnoreHeaders: avr/common.h, as avr/io*.h SREG and the stack pointer, which every AVR has, are in avr/common.h, which includes as it does a part's header. include-cleaner took it for their provider and asked a file that writes SREG for it; found in MaxMatrix, whose bit banging saves and restores SREG. --- template/.clang-tidy | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/template/.clang-tidy b/template/.clang-tidy index 034bc5c..b1b06ef 100644 --- a/template/.clang-tidy +++ b/template/.clang-tidy @@ -155,8 +155,10 @@ CheckOptions: # it, at times through a second one, as iom2560.h through iomxx0_1.h, which # include-cleaner does not take back to . Any core's folder, not # only cores/arduino/ of Arduino's: a third party's core has its own, as - # cores/xmega/ of XMegaForArduino's, where Serial comes from. - misc-include-cleaner.IgnoreHeaders: '.*/cores/[^/]+/.*;.*/variants/.*;.*/avr/io[^/]*\.h' + # cores/xmega/ of XMegaForArduino's, where Serial comes from. And + # avr/common.h, which includes as well, for the registers every + # AVR has, SREG and the stack pointer among them. + misc-include-cleaner.IgnoreHeaders: '.*/cores/[^/]+/.*;.*/variants/.*;.*/avr/io[^/]*\.h;.*/avr/common\.h' # Google's names, which readability-identifier-naming checks only once it is told them; the # same block in every project, so that every project names alike. Two exceptions Google # makes itself are general: an accessor is named like the variable it gives (group(), From f9589b5007df9351cc234114155327428139df43 Mon Sep 17 00:00:00 2001 From: virskl Date: Mon, 16 Nov 2026 16:20:02 +0100 Subject: [PATCH 2/2] CHANGELOG: IgnoreHeaders leaves out avr/common.h --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 816b06a..d26cffb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ What changed in each version of the template, and what a project has to do when `copier update` brings it. +## Unreleased + +- **`misc-include-cleaner` leaves out `avr/common.h`, as `avr/io*.h`:** avr-libc keeps `SREG`, + the stack pointer and the other registers every AVR has in `avr/common.h`, which `` + includes, and include-cleaner asked a file that wrote `SREG` for that header, though + `` is the one to include. Found in MaxMatrix, which saves and restores `SREG` around + a write to a port. + +On the update: nothing to do. A project that added `avr/common.h` to `IgnoreHeaders` itself, or +included it, can drop that. + ## v0.12.0 A project of several targets can have an example for one board alone: `EXAMPLES` names the