Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 23249 - Deprecation: argument &p for format specification "%m" must be char*, not char** #14307

Merged
merged 1 commit into from
Jul 19, 2022

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Jul 15, 2022

Properly implement %m extension. Still missing %m[xxx], but that is related to issue 23251.

At this point, I'm not sure whether it would be better to hoist the printf and scanf-specific parsing into parsePrintfFormatSpecifier and parseScanfFormatSpecifier respectively - calling parseGenericFormatSpecifier only if not handling any context-dependent formats.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
23249 normal Deprecation: argument &p for format specification "%m" must be char*, not char**

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14307"

compiler/src/dmd/chkformat.d Outdated Show resolved Hide resolved
Copy link
Contributor

@Luhrel Luhrel left a comment

Choose a reason for hiding this comment

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

Thanks for spotting and fixing this bug !

compiler/src/dmd/chkformat.d Outdated Show resolved Hide resolved
compiler/src/dmd/chkformat.d Outdated Show resolved Hide resolved
@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 16, 2022

Sorted out the implementation, the tests are yet to be updated.

@ibuclaw ibuclaw force-pushed the issue23249 branch 4 times, most recently from 55c6289 to fe4f7f4 Compare July 18, 2022 20:08
@@ -27,48 +33,38 @@ void main()
#line 100
printf("%m this is a string in errno");
printf("%s %m", "str".ptr, 2);
Copy link
Member Author

Choose a reason for hiding this comment

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

Should the chkformat complain when there are more arguments than format specifiers @WalterBright?

@ibuclaw
Copy link
Member Author

ibuclaw commented Jul 19, 2022

This is fine for now, fixing scansets will be next.

@dlang-bot dlang-bot merged commit 172597e into dlang:master Jul 19, 2022
@ibuclaw ibuclaw deleted the issue23249 branch July 19, 2022 17:30
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.

4 participants