Clang: Manually Disable Warnings in a Specific Location

Utilizing public or generated code can often introduce warnings into your software builds. Many of these warnings are not serious and developers will often ignore them. This pollutes the warning report and prevents developers from noticing useful warnings in their own software.

Using clang, you can suppress warnings using a #pragma:

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wfloat-equal -Wdeprecated"
#include <annoying_warning_creating_header.h>
#pragma clang diagnostic pop

I've often used this approach to silence acceptable warnings from external code.