How to write compile time for user

I would like to write a Pragma warning in GNU g ++ for every user who compiles my codes.

How can i do this? I am using the GNU g ++ compiler.

+6
source share
1 answer

Support for MSVC and the new GCC:

#pragma message ( "your warning text here" ) 

GCC also uses a different syntax:

 #warning "you warning text here" 

See also the question: Portability of the Preprocessor Directive # Warnings and GCC Documentation

+14
source

Source: https://habr.com/ru/post/922175/


All Articles