Yousha Aleayoub
Yousha Aleayoub

Reputation: 5618

How to WRITE compile time warning for user

I would like to write a Pragma warning in GNU G++ for every user that compile my codes.

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

Upvotes: 8

Views: 7523

Answers (1)

Rafał Rawicki
Rafał Rawicki

Reputation: 22690

MSVC and newer GCCs support:

#pragma message ( "your warning text here" )

In GCC the other syntax is also commonly used:

#warning "you warning text here"

See also question: Portability of #warning preprocessor directive and GCC documentation

Upvotes: 19

Related Questions