Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 40d5de0

Browse files
Merge pull request #3105 from WalterBright/vararg-attr
add scope and const to variadic functions
2 parents 5cf6184 + 75ac9a7 commit 40d5de0

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

src/core/stdc/stdio.d

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,25 +1167,25 @@ version (MinGW)
11671167
// reals at all.
11681168
///
11691169
pragma(printf)
1170-
int __mingw_fprintf(FILE* stream, scope const char* format, ...);
1170+
int __mingw_fprintf(FILE* stream, scope const char* format, scope const ...);
11711171
///
11721172
alias __mingw_fprintf fprintf;
11731173

11741174
///
11751175
pragma(scanf)
1176-
int __mingw_fscanf(FILE* stream, scope const char* format, ...);
1176+
int __mingw_fscanf(FILE* stream, scope const char* format, scope ...);
11771177
///
11781178
alias __mingw_fscanf fscanf;
11791179

11801180
///
11811181
pragma(printf)
1182-
int __mingw_sprintf(scope char* s, scope const char* format, ...);
1182+
int __mingw_sprintf(scope char* s, scope const char* format, scope const ...);
11831183
///
11841184
alias __mingw_sprintf sprintf;
11851185

11861186
///
11871187
pragma(scanf)
1188-
int __mingw_sscanf(scope const char* s, scope const char* format, ...);
1188+
int __mingw_sscanf(scope const char* s, scope const char* format, scope ...);
11891189
///
11901190
alias __mingw_sscanf sscanf;
11911191

@@ -1227,30 +1227,30 @@ version (MinGW)
12271227

12281228
///
12291229
pragma(printf)
1230-
int __mingw_printf(scope const char* format, ...);
1230+
int __mingw_printf(scope const char* format, scope const ...);
12311231
///
12321232
alias __mingw_printf printf;
12331233

12341234
///
12351235
pragma(scanf)
1236-
int __mingw_scanf(scope const char* format, ...);
1236+
int __mingw_scanf(scope const char* format, scope ...);
12371237
///
12381238
alias __mingw_scanf scanf;
12391239
}
12401240
else
12411241
{
12421242
///
12431243
pragma(printf)
1244-
int fprintf(FILE* stream, scope const char* format, ...);
1244+
int fprintf(FILE* stream, scope const char* format, scope const ...);
12451245
///
12461246
pragma(scanf)
1247-
int fscanf(FILE* stream, scope const char* format, ...);
1247+
int fscanf(FILE* stream, scope const char* format, scope ...);
12481248
///
12491249
pragma(printf)
1250-
int sprintf(scope char* s, scope const char* format, ...);
1250+
int sprintf(scope char* s, scope const char* format, scope const ...);
12511251
///
12521252
pragma(scanf)
1253-
int sscanf(scope const char* s, scope const char* format, ...);
1253+
int sscanf(scope const char* s, scope const char* format, scope ...);
12541254
///
12551255
pragma(printf)
12561256
int vfprintf(FILE* stream, scope const char* format, va_list arg);
@@ -1271,10 +1271,10 @@ else
12711271
int vscanf(scope const char* format, va_list arg);
12721272
///
12731273
pragma(printf)
1274-
int printf(scope const char* format, ...);
1274+
int printf(scope const char* format, scope const ...);
12751275
///
12761276
pragma(scanf)
1277-
int scanf(scope const char* format, ...);
1277+
int scanf(scope const char* format, scope ...);
12781278
}
12791279

12801280
// No unsafe pointer manipulation.
@@ -1348,7 +1348,7 @@ version (CRuntime_DigitalMars)
13481348
}
13491349
///
13501350
pragma(printf)
1351-
int _snprintf(scope char* s, size_t n, scope const char* fmt, ...);
1351+
int _snprintf(scope char* s, size_t n, scope const char* fmt, scope const ...);
13521352
///
13531353
alias _snprintf snprintf;
13541354

@@ -1378,7 +1378,7 @@ else version (CRuntime_Microsoft)
13781378
version (MinGW)
13791379
{
13801380
pragma(printf)
1381-
int __mingw_snprintf(scope char* s, size_t n, scope const char* fmt, ...);
1381+
int __mingw_snprintf(scope char* s, size_t n, scope const char* fmt, scope const ...);
13821382
///
13831383
alias __mingw_snprintf _snprintf;
13841384
///
@@ -1396,10 +1396,10 @@ else version (CRuntime_Microsoft)
13961396
{
13971397
///
13981398
pragma(printf)
1399-
int _snprintf(scope char* s, size_t n, scope const char* format, ...);
1399+
int _snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
14001400
///
14011401
pragma(printf)
1402-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1402+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
14031403

14041404
///
14051405
pragma(printf)
@@ -1443,7 +1443,7 @@ else version (CRuntime_Glibc)
14431443

14441444
///
14451445
pragma(printf)
1446-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1446+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
14471447
///
14481448
pragma(printf)
14491449
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1467,7 +1467,7 @@ else version (Darwin)
14671467

14681468
///
14691469
pragma(printf)
1470-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1470+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
14711471
///
14721472
pragma(printf)
14731473
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1491,7 +1491,7 @@ else version (FreeBSD)
14911491

14921492
///
14931493
pragma(printf)
1494-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1494+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
14951495
///
14961496
pragma(printf)
14971497
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1515,7 +1515,7 @@ else version (NetBSD)
15151515

15161516
///
15171517
pragma(printf)
1518-
int snprintf(char* s, size_t n, const scope char* format, ...);
1518+
int snprintf(char* s, size_t n, const scope char* format, scope const ...);
15191519
///
15201520
pragma(printf)
15211521
int vsnprintf(char* s, size_t n, const scope char* format, va_list arg);
@@ -1608,7 +1608,7 @@ else version (OpenBSD)
16081608

16091609
///
16101610
pragma(printf)
1611-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1611+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
16121612
///
16131613
pragma(printf)
16141614
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1642,7 +1642,7 @@ else version (DragonFlyBSD)
16421642
enum __SIGN = 0x8000;
16431643

16441644
pragma(printf)
1645-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1645+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
16461646
pragma(printf)
16471647
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
16481648
}
@@ -1665,7 +1665,7 @@ else version (Solaris)
16651665

16661666
///
16671667
pragma(printf)
1668-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1668+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
16691669
///
16701670
pragma(printf)
16711671
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1689,7 +1689,7 @@ else version (CRuntime_Bionic)
16891689

16901690
///
16911691
pragma(printf)
1692-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1692+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
16931693
///
16941694
pragma(printf)
16951695
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1712,7 +1712,7 @@ else version (CRuntime_Musl)
17121712

17131713
///
17141714
pragma(printf)
1715-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1715+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
17161716
///
17171717
pragma(printf)
17181718
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);
@@ -1736,7 +1736,7 @@ else version (CRuntime_UClibc)
17361736

17371737
///
17381738
pragma(printf)
1739-
int snprintf(scope char* s, size_t n, scope const char* format, ...);
1739+
int snprintf(scope char* s, size_t n, scope const char* format, scope const ...);
17401740
///
17411741
pragma(printf)
17421742
int vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg);

src/core/stdc/wchar_.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ alias wchar_t wint_t;
128128
enum wchar_t WEOF = 0xFFFF;
129129

130130
///
131-
int fwprintf(FILE* stream, const scope wchar_t* format, ...);
131+
int fwprintf(FILE* stream, const scope wchar_t* format, scope const ...);
132132
///
133-
int fwscanf(FILE* stream, const scope wchar_t* format, ...);
133+
int fwscanf(FILE* stream, const scope wchar_t* format, scope ...);
134134
///
135-
int swprintf(wchar_t* s, size_t n, const scope wchar_t* format, ...);
135+
int swprintf(wchar_t* s, size_t n, const scope wchar_t* format, scope const ...);
136136
///
137-
int swscanf(const scope wchar_t* s, const scope wchar_t* format, ...);
137+
int swscanf(const scope wchar_t* s, const scope wchar_t* format, scope ...);
138138
///
139139
int vfwprintf(FILE* stream, const scope wchar_t* format, va_list arg);
140140
///
@@ -148,9 +148,9 @@ int vwprintf(const scope wchar_t* format, va_list arg);
148148
///
149149
int vwscanf(const scope wchar_t* format, va_list arg);
150150
///
151-
int wprintf(const scope wchar_t* format, ...);
151+
int wprintf(const scope wchar_t* format, scope const ...);
152152
///
153-
int wscanf(const scope wchar_t* format, ...);
153+
int wscanf(const scope wchar_t* format, scope ...);
154154

155155
// No unsafe pointer manipulation.
156156
@trusted

0 commit comments

Comments
 (0)