• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Dokkio Sidebar (from the makers of PBworks) is a Chrome extension that eliminates the need for endless browser tabs. You can search all your online stuff without any extra effort. And Sidebar was #1 on Product Hunt! Check out what people are saying by clicking here.



Page history last edited by Kenneth Finnegan 14 years, 4 months ago

This preprocessor directive can be used to make a file not compile with your own error message saying what's wrong, or just cause a warning to be displayed.



#error "Custom error message saying what is wrong"


#warning "Custom warning message"



int foo(int i) {

     #error "Function foo not yet implemented"



int bar(int j) {

     #warning "Function bar may not behave as expected all the time"




This could be used with #if to check properties of the environment

#if sizeof(int) < 4

     #error sizeof Int is too small, must be at least 4 bytes





Comments (0)

You don't have permission to comment on this page.