Skip to content

printf.h: definition of ATTR_PRINTF is invalid without __GNUC__ #126

@smcpeak

Description

@smcpeak

As of commit 87878b2, printf.h when preprocessed without __GNUC__ has this macro definition:

# define ATTR_PRINTF((one_based_format_index), (first_arg))

This is invalid since the macro parameters have extra parentheses. cpp -undef (which does not set __GNUC__) complains:

$ cpp -undef printf.h >/dev/null
printf.h:56:22: error: expected parameter name, found "("
   56 | # define ATTR_PRINTF((one_based_format_index), (first_arg))
      |                      ^
Exit 1
$ cpp --version
cpp (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0

In the original commit, that line should not have been changed.

Ideally, there should also be an automated test that exercises this printf implementation without __GNUC__, as that would have caught this error.

Metadata

Metadata

Assignees

Labels

resolved-on-developA changeset fixing this issue has been commiutted to the development branch

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions