8

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.

Yousha Aleayoub
  • 4,532
  • 4
  • 53
  • 64

1 Answers1

19

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

Community
  • 1
  • 1
Rafał Rawicki
  • 22,324
  • 5
  • 59
  • 79