dmd.errors - D Programming Language
Description: D Programming Language
Keywords: D programming language

Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Calendar
  - Forums
  - IRC
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

# dmd.errors

Compiler implementation of the D programming language.
Authors:
Walter Bright
License:
Boost License 1.0

Source errors.d

Documentation https://dlang.org/phobos/dmd_errors.html

Coverage https://codecov.io/gh/dlang/dmd/src/master/src/dmd/errors.d

abstract class `DiagnosticReporter`;
  Interface for diagnostic reporting.
  abstract nothrow int `errorCount`();
    Returns:
    the number of errors that occurred during lexing or parsing.
  abstract nothrow int `warningCount`();
    Returns:
    the number of warnings that occurred during lexing or parsing.
  abstract nothrow int `deprecationCount`();
    Returns:
    the number of deprecations that occurred during lexing or parsing.
  final nothrow void `error`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `error`(ref const Loc `loc`, const(char)* `format`, va_list `args`);
    Reports an error message.
    Parameters:

    Loc `loc` | Location of error
    const(char)* `format` | format string for error
    ... | format string arguments

  final nothrow void `errorSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `errorSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list);
    Reports additional details about an error message.
    Parameters:

    Loc `loc` | Location of error
    const(char)* `format` | format string for supplemental message
    ... | format string arguments

  final nothrow void `warning`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `warning`(ref const Loc `loc`, const(char)* `format`, va_list `args`);
    Reports a warning message.
    Parameters:

    Loc `loc` | Location of warning
    const(char)* `format` | format string for warning
    ... | format string arguments

  final nothrow void `warningSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `warningSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list);
    Reports additional details about a warning message.
    Parameters:

    Loc `loc` | Location of warning
    const(char)* `format` | format string for supplemental message
    ... | format string arguments

  final nothrow void `deprecation`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `deprecation`(ref const Loc `loc`, const(char)* `format`, va_list `args`);
    Reports a deprecation message.
    Parameters:

    Loc `loc` | Location of the deprecation
    const(char)* `format` | format string for the deprecation
    ... | format string arguments

  final nothrow void `deprecationSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  abstract nothrow void `deprecationSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list);
    Reports additional details about a deprecation message.
    Parameters:

    Loc `loc` | Location of deprecation
    const(char)* `format` | format string for supplemental message
    ... | format string arguments

class `StderrDiagnosticReporter`: dmd.errors.DiagnosticReporter;
  Diagnostic reporter which prints the diagnostic messages to stderr.
  This is usually the default diagnostic reporter.
  nothrow this(DiagnosticReporting `useDeprecated`);
    Initializes this object.
    Parameters:

    DiagnosticReporting `useDeprecated` | indicates how deprecation diagnostics should be handled

enum `Classification`: Color;
  Color highlighting to classify messages
  `error`
    for errors
  `gagged`
    for gagged errors
  `warning`
    for warnings
  `deprecation`
    for deprecations
  `tip`
    for tip messages
nothrow void `error`(ref const Loc `loc`, const(char)* `format`, ...);
  Print an error message, increasing the global error count.
  Parameters:

  Loc `loc` | location of error
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `error`(Loc `loc`, const(char)* `format`, ...);
  Same as above, but allows Loc() literals to be passed.
  Parameters:

  Loc `loc` | location of error
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `error`(const(char)* `filename`, uint `linnum`, uint `charnum`, const(char)* `format`, ...);
  Same as above, but takes a filename and line information arguments as separate parameters.
  Parameters:

  const(char)* `filename` | source file of error
  uint `linnum` | line in the source file
  uint `charnum` | column number on the line
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `errorSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  Print additional details about an error message. Doesn't increase the error count or print an additional error prefix.
  Parameters:

  Loc `loc` | location of error
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `warning`(ref const Loc `loc`, const(char)* `format`, ...);
  Print a warning message, increasing the global warning count.
  Parameters:

  Loc `loc` | location of warning
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `warningSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  Print additional details about a warning message. Doesn't increase the warning count or print an additional warning prefix.
  Parameters:

  Loc `loc` | location of warning
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `deprecation`(ref const Loc `loc`, const(char)* `format`, ...);
  Print a deprecation message, may increase the global warning or error count depending on whether deprecations are ignored.
  Parameters:

  Loc `loc` | location of deprecation
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `deprecationSupplemental`(ref const Loc `loc`, const(char)* `format`, ...);
  Print additional details about a deprecation message. Doesn't increase the error count, or print an additional deprecation prefix.
  Parameters:

  Loc `loc` | location of deprecation
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `message`(ref const Loc `loc`, const(char)* `format`, ...);
  Print a verbose message. Doesn't prefix or highlight messages.
  Parameters:

  Loc `loc` | location of message
  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `message`(const(char)* `format`, ...);
  Same as above, but doesn't take a location argument.
  Parameters:

  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `tip`(const(char)* `format`, ...);
  Print a tip message with the prefix and highlighting.
  Parameters:

  const(char)* `format` | printf-style format specification
  ... | printf-style variadic arguments

nothrow void `verror`(ref const Loc `loc`, const(char)* `format`, va_list `ap`, const(char)* `p1` = null, const(char)* `p2` = null, const(char)* `header` = "Error: ");
  Same as error, but takes a va_list parameter, and optionally additional message prefixes.
  Parameters:

  Loc `loc` | location of error
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments
  const(char)* `p1` | additional message prefix
  const(char)* `p2` | additional message prefix
  const(char)* `header` | title of error message

nothrow void `verrorSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list `ap`);
  Same as errorSupplemental, but takes a va_list parameter.
  Parameters:

  Loc `loc` | location of error
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `vwarning`(ref const Loc `loc`, const(char)* `format`, va_list `ap`);
  Same as warning, but takes a va_list parameter.
  Parameters:

  Loc `loc` | location of warning
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `vwarningSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list `ap`);
  Same as warningSupplemental, but takes a va_list parameter.
  Parameters:

  Loc `loc` | location of warning
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `vdeprecation`(ref const Loc `loc`, const(char)* `format`, va_list `ap`, const(char)* `p1` = null, const(char)* `p2` = null);
  Same as deprecation, but takes a va_list parameter, and optionally additional message prefixes.
  Parameters:

  Loc `loc` | location of deprecation
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments
  const(char)* `p1` | additional message prefix
  const(char)* `p2` | additional message prefix

nothrow void `vmessage`(ref const Loc `loc`, const(char)* `format`, va_list `ap`);
  Same as message, but takes a va_list parameter.
  Parameters:

  Loc `loc` | location of message
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `vtip`(const(char)* `format`, va_list `ap`);
  Same as tip, but takes a va_list parameter.
  Parameters:

  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `vdeprecationSupplemental`(ref const Loc `loc`, const(char)* `format`, va_list `ap`);
  Same as deprecationSupplemental, but takes a va_list parameter.
  Parameters:

  Loc `loc` | location of deprecation
  const(char)* `format` | printf-style format specification
  va_list `ap` | printf-style variadic arguments

nothrow void `fatal`();
  Call this after printing out fatal error messages to clean up and exit the compiler.
nothrow void `halt`();
  Try to stop forgetting to remove the breakpoints from release builds.
enum `HIGHLIGHT`: ubyte;
  Embed these highlighting commands in the text stream. HIGHLIGHT.Escape indicates a Color follows.

Copyright © 1999-2019 by the D Language Foundation | Page generated by Ddoc on Fri Oct 11 06:43:26 2019