HPlogo HP C++ Programmer's Guide: HP 9000 Series Workstations and Servers > Chapter 2 The HP C++ Preprocessor

Error Directive

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

Syntax

error-directive ::=
     #error [preprocessor tokens]

Description

The #error directive causes a diagnostic message, along with any included token arguments, to be produced by HP C++.

Examples

     // This directive will produce the diagnostic
     // message "FLAG not defined!".
#ifndef FLAG
#error "FLAG not defined!"
#endif

     // This directive will produce the diagnostic
     // message "TABLE_SIZE must be a multiple of 256!".
#if TABLE_SIZE % 256 != 0
#error "TABLE_SIZE must be a multiple of 256!"
#endif
NOTE: The #error directive is not supported when using the compatibility mode preprocessor.
© Hewlett-Packard Development Company, L.P.