Skip to content

document printf format validation#2760

Merged
WalterBright merged 1 commit intodlang:masterfrom
WalterBright:chkprintf
Feb 24, 2020
Merged

document printf format validation#2760
WalterBright merged 1 commit intodlang:masterfrom
WalterBright:chkprintf

Conversation

@WalterBright
Copy link
Member

Rewrote the section about calling printf to support its implementation dlang/dmd#10812

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

spec/betterc.dd Outdated
$(LI `switch` with strings)
$(LI `final switch`)
$(LI `unittest`)
$(DDSUBLINK spec/interfaceToC, calling_printf, `printf` format validation)
Copy link
Member

@PetarKirov PetarKirov Feb 24, 2020

Choose a reason for hiding this comment

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

Needs to be wrapped in $(LI ... ) as it's part of $(OL ... ) (ordered html list). I'll fix it myself.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@PetarKirov PetarKirov left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to add the auto-merge label to the PR when ready.

@WalterBright WalterBright merged commit 7c8339d into dlang:master Feb 24, 2020
@WalterBright WalterBright deleted the chkprintf branch February 24, 2020 18:34
)
---
string format = "value: %K\n";
printf(format, value);
Copy link
Contributor

Choose a reason for hiding this comment

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

I very much doubt that will actually compile. Have you tested it?

I believe it will have to be format.ptr...

Copy link
Contributor

Choose a reason for hiding this comment

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

Probably better to make the original format variable const char* so it gets properly null-terminated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants