Skip to content

Commit 33036df

Browse files
committed
errors: Remove toplevel warning entrypoints
These are now unused, their removal discourages adding new warnings to the language.
1 parent 7fbcf2b commit 33036df

File tree

6 files changed

+1
-67
lines changed

6 files changed

+1
-67
lines changed

compiler/src/dmd/errors.d

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ __gshared Diagnostic[] diagnostics = [];
5757
class ErrorSinkCompiler : ErrorSink
5858
{
5959
nothrow:
60-
extern (C++):
6160
override:
6261

6362
void verror(Loc loc, const(char)* format, va_list ap)
@@ -246,55 +245,6 @@ else
246245
va_end(ap);
247246
}
248247

249-
/**
250-
* Print a warning message, increasing the global warning count.
251-
* Params:
252-
* loc = location of warning
253-
* format = printf-style format specification
254-
* ... = printf-style variadic arguments
255-
*/
256-
static if (__VERSION__ < 2092)
257-
extern (C++) void warning(Loc loc, const(char)* format, ...)
258-
{
259-
va_list ap;
260-
va_start(ap, format);
261-
vreportDiagnostic(loc, format, ap, ErrorKind.warning);
262-
va_end(ap);
263-
}
264-
else
265-
pragma(printf) extern (C++) void warning(Loc loc, const(char)* format, ...)
266-
{
267-
va_list ap;
268-
va_start(ap, format);
269-
vreportDiagnostic(loc, format, ap, ErrorKind.warning);
270-
va_end(ap);
271-
}
272-
273-
/**
274-
* Print additional details about a warning message.
275-
* Doesn't increase the warning count or print an additional warning prefix.
276-
* Params:
277-
* loc = location of warning
278-
* format = printf-style format specification
279-
* ... = printf-style variadic arguments
280-
*/
281-
static if (__VERSION__ < 2092)
282-
extern (C++) void warningSupplemental(Loc loc, const(char)* format, ...)
283-
{
284-
va_list ap;
285-
va_start(ap, format);
286-
vsupplementalDiagnostic(loc, format, ap, ErrorKind.warning);
287-
va_end(ap);
288-
}
289-
else
290-
pragma(printf) extern (C++) void warningSupplemental(Loc loc, const(char)* format, ...)
291-
{
292-
va_list ap;
293-
va_start(ap, format);
294-
vsupplementalDiagnostic(loc, format, ap, ErrorKind.warning);
295-
va_end(ap);
296-
}
297-
298248
/**
299249
* Print a deprecation message, may increase the global warning or error count
300250
* depending on whether deprecations are ignored.

compiler/src/dmd/errors.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ enum class ErrorKind
3131
#endif
3232

3333
// Print a warning, deprecation, or error, accepts printf-like format specifiers.
34-
D_ATTRIBUTE_FORMAT(2, 3) void warning(Loc loc, const char *format, ...);
35-
D_ATTRIBUTE_FORMAT(2, 3) void warningSupplemental(Loc loc, const char *format, ...);
3634
D_ATTRIBUTE_FORMAT(2, 3) void deprecation(Loc loc, const char *format, ...);
3735
D_ATTRIBUTE_FORMAT(2, 3) void deprecationSupplemental(Loc loc, const char *format, ...);
3836
D_ATTRIBUTE_FORMAT(2, 3) void error(Loc loc, const char *format, ...);

compiler/src/dmd/errorsink.d

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import dmd.location;
2121
abstract class ErrorSink
2222
{
2323
nothrow:
24-
extern (C++):
2524

2625
void verror(Loc loc, const(char)* format, va_list ap);
2726
void verrorSupplemental(Loc loc, const(char)* format, va_list ap);
@@ -103,7 +102,6 @@ abstract class ErrorSink
103102
class ErrorSinkNull : ErrorSink
104103
{
105104
nothrow:
106-
extern (C++):
107105
override:
108106

109107
void verror(Loc loc, const(char)* format, va_list ap) { }
@@ -127,7 +125,6 @@ class ErrorSinkNull : ErrorSink
127125
class ErrorSinkLatch : ErrorSinkNull
128126
{
129127
nothrow:
130-
extern (C++):
131128
override:
132129

133130
bool sawErrors;
@@ -145,7 +142,6 @@ class ErrorSinkStderr : ErrorSink
145142
import core.stdc.stdarg;
146143

147144
nothrow:
148-
extern (C++):
149145
override:
150146

151147
void verror(Loc loc, const(char)* format, va_list ap)

compiler/src/dmd/frontend.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8256,10 +8256,6 @@ extern void errorBackend(const char* filename, uint32_t linnum, uint32_t charnum
82568256

82578257
extern void errorSupplemental(Loc loc, const char* format, ...);
82588258

8259-
extern void warning(Loc loc, const char* format, ...);
8260-
8261-
extern void warningSupplemental(Loc loc, const char* format, ...);
8262-
82638259
extern void deprecation(Loc loc, const char* format, ...);
82648260

82658261
extern void deprecationSupplemental(Loc loc, const char* format, ...);

compiler/src/dmd/lexer.d

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,11 +3129,6 @@ class Lexer
31293129
eSink.deprecation(loc, format, args);
31303130
}
31313131

3132-
void warning(T...)(Loc loc, const(char)* format, T args)
3133-
{
3134-
eSink.warning(loc, format, args);
3135-
}
3136-
31373132
void deprecation(T...)(const(char)* format, T args)
31383133
{
31393134
eSink.deprecation(token.loc, format, args);
@@ -3618,7 +3613,6 @@ unittest
36183613
static class ErrorSinkTest : ErrorSinkNull
36193614
{
36203615
nothrow:
3621-
extern (C++):
36223616
override:
36233617

36243618
import core.stdc.stdio;

compiler/src/dmd/link.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1610,7 +1610,7 @@ clang: error: linker command failed with exit code 1 (use -v to see invocation)
16101610
class ErrorSinkTest : ErrorSinkNull
16111611
{
16121612
OutBuffer result;
1613-
extern(C++): override:
1613+
override:
16141614

16151615
void verror(Loc loc, const(char)* format, va_list ap)
16161616
{

0 commit comments

Comments
 (0)