Disable specific warnings in GCC [duplicate]

Solution 1:

From the GCC manual:

Many options have long names starting with -f or with -W---for example, -fforce-mem, -fstrength-reduce, -Wformat and so on. Most of these have both positive and negative forms; the negative form of -ffoo would be -fno-foo. This manual documents only one of these two forms, whichever one is not the default.

But if you're asking whether there is a source-level warning disable, I'm not aware if that feature exists in GCC.

Solution 2:

-Wno-multichar:

Do not warn if a multicharacter constant ('FOOF') is used. Usually they indicate a typo in the user's code, as they have implementation-defined values, and should not be used in portable code.

More information.

Solution 3:

Inside the source code, write:

#pragma GCC diagnostic ignored "-Wno-multichar"

// Code with warnings, but they won’t be displayed now...