Skip to content

Fmt attr fix#168

Merged
ac000 merged 2 commits into
masterfrom
fmt-attr-fix
Mar 10, 2026
Merged

Fmt attr fix#168
ac000 merged 2 commits into
masterfrom
fmt-attr-fix

Conversation

@ac000

@ac000 ac000 commented Mar 10, 2026

Copy link
Copy Markdown
Owner

No description provided.

ac000 added 2 commits March 10, 2026 05:18
Signed-off-by: Andrew Clayton <ac@sigsegv.uk>
We use the 'format' function attribute on the _logger() function to do
checking of the specified arguments against the specified format.

However this was actually working, i.e. no warning was being generated
when specifying incorrect arguments.

The attribute needs to be associated with the function prototype, or the
function definition iff there isn't a separate prototype, which is where
it was being specified. However there is a function prototype for
_logger() in a header file and that is where we need to specify the
function attribute.

With this the compiler now provides the desired warnings.

Signed-off-by: Andrew Clayton <ac@sigsegv.uk>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the logger API to enable compiler printf-style format checking via a function attribute, and adjusts the project’s version “PLUS” suffix.

Changes:

  • Move the GCC/Clang format(printf, ...) attribute from _logger()’s definition into its prototype in logger.h.
  • Update copyright headers to 2026.
  • Set PLUS in version.mk to +.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
version.mk Changes version suffix used to construct build/version strings.
src/logger.h Adds format(printf, 3, 4) attribute to _logger() declaration for format checking.
src/logger.c Removes the format attribute from the _logger() definition (now declared in header).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread version.mk
@ac000 ac000 merged commit ee7eafd into master Mar 10, 2026
12 checks passed
@ac000 ac000 deleted the fmt-attr-fix branch March 10, 2026 05:34
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