Bug 22784 – pragma(printf) applies to nested functions

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-02-17T03:16:05Z
Last change time
2022-10-07T03:06:31Z
Keywords
pull
Assigned to
No Owner
Creator
duser

Comments

Comment #0 by duser — 2022-02-17T03:16:05Z
example: import core.stdc.stdarg; extern(C) pragma(printf) void fn(const(char)* fmt, ...) { void inner(){} } output: test.d(6): Error: function `test.fn.inner` `pragma(printf)` functions must be `extern(C) void inner([parameters...], const(char)*, va_list)` i'd expect the pragma to apply to the outer function only so you can have non-printf-like helper functions inside a printf-like function
Comment #1 by dlang-bot — 2022-09-30T12:16:38Z
@dkorpel updated dlang/dmd pull request #14503 "Fix 22784 - pragma(printf) applies to nested functions" fixing this issue: - Fix 22784 - pragma(printf) applies to nested functions https://github.com/dlang/dmd/pull/14503