Programming Tips - gcc: How can I turn off a gcc compiler warning in my code?

Date: 2015jun4 Update: 2025aug13 Product: gcc OS: Linux Language: C/C++ Q. gcc: How can I turn off a gcc compiler warning in my code? (Not on the command line) A. Use a pragma like this:
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"