Skip to content

IgnoreHeaders: avr/common.h, as avr/io*.h - #105

Merged
theAndreas merged 2 commits into
mainfrom
ignore-avr-common
Nov 16, 2026
Merged

theAndreas merged 2 commits into
mainfrom
ignore-avr-common

Conversation

@theAndreas

Copy link
Copy Markdown
Owner

A file that writes SREG, as code does that holds the interrupts off and puts them back, failed make tidy: misc-include-cleaner asked it to include avr/common.h. avr-libc keeps the registers every AVR has there, SREG and the stack pointer among them, and <avr/io.h> includes it, as it includes a part's own header; include-cleaner does not take either back to <avr/io.h>. IgnoreHeaders already leaves out avr/io*.h for the part's headers and now leaves out avr/common.h as well, so that <avr/io.h> is what a file includes for SREG.

MaxMatrix ran into it when it turned the check on (its OIL 41, F-5) and added the pattern as an exception of its own, which it can drop after the update.

For a project: nothing to do.

How it was checked: a project made from this branch, its SelfCheck printing SREG. With the old pattern, make tidy reports no header providing "SREG" is directly included; with the new one it passes. tests/check.sh tidy passes.

SREG and the stack pointer, which every AVR has, are in avr/common.h,
which <avr/io.h> 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.
@theAndreas
theAndreas merged commit a5b61e6 into main Nov 16, 2026
1 check passed
@theAndreas
theAndreas deleted the ignore-avr-common branch November 16, 2026 15:36
@theAndreas theAndreas mentioned this pull request Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants