Diagnostic directives for the fpx preprocessor.
This module implements the handling of the preprocessor directives #error and #warning, allowing source files to emit user-defined diagnostics during preprocessing.
These directives are commonly used to enforce configuration requirements, reject unsupported platforms, report deprecated features, or notify users about assumptions made during compilation.
Supported directives:
The diagnostic text consists of the remainder of the directive line following the keyword itself.
| subroutine, public handle_error | ( | type(context), intent(in) | ctx, |
| type(macro), dimension(:), intent(inout), allocatable | macros, | ||
| character(*), intent(in) | token ) |
Process a #error directive.
Extracts the message following the directive keyword and immediately terminates preprocessing using an error stop statement.
This directive is intended for unrecoverable situations such as unsupported targets, invalid configurations, or missing prerequisites.
| [in] | ctx | Source context containing the complete #error directive. |
| [in,out] | macros | Active macro table. Present for interface consistency and not modified. |
| [in] | token | Directive keyword, typically "error". |
Definition at line 104 of file diagnostics.f90.
| subroutine, public handle_warning | ( | type(context), intent(in) | ctx, |
| type(macro), dimension(:), intent(inout), allocatable | macros, | ||
| character(*), intent(in) | token ) |
Process a #warning directive.
Extracts the message following the directive keyword and writes it to the standard output stream without interrupting preprocessing.
This directive is intended for non-fatal conditions such as deprecated features, unusual build settings, or informational notices.
| [in] | ctx | Source context containing the complete #warning directive. |
| [in,out] | macros | Active macro table. Present for interface consistency and not modified. |
| [in] | token | Directive keyword, typically "warning". |
Definition at line 131 of file diagnostics.f90.