Suppress GCC warnings

I have a code:

#ifdef Q_OS_LINUX
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcomment"
#include "header.h"
#pragma GCC diagnostic pop
#endif

And I want to suppress the GCC warning messages related to header.h and all the headers included in header.h. But I still have "-Wcomment" warnings related to the headers included in header.h. How can i avoid this? Thanks

gcc 4.8.2

edit: The warning I get is as follows:

/ ------ Set the analog output for 8022/8026 --------- / Exp8K WORD CALLBACK AnalogOutHex_8K (DWORD dwBuf [], float fBuf [], warning: "/" in comment [-Wcomment] No other pragmas. -Wall doesn't work.

+4
source share
3 answers

GCC, , ++, C. ++ ( C ). :

#pragma GCC diagnostic ignored "-Wcomment"
/* /* */

++, C.

, , . , . , , ( -isystem).

+2

header.h, , #pragma GCC system_header. gcc -isystem.

, , '#warning (. ), , GCC .

+1

cpp. , . , , , . #pragma .

#pragmas , - . , .

0

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


All Articles