[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Proposal: Making Debian compiler agnostic



Vincent Danjean <vdanjean.ml@free.fr> writes:

> There exists some kind of push/pop but I'm not sure it is relevant is
> your context nor that llvm/clang support them.
>   In one of my projects where I include a header file that produces
> warnings (with #warning ...) and that adds the "deprecated" attribute
> to some function, I use:

> #pragma GCC diagnostic push
> #  pragma GCC diagnostic ignored "-Wcpp"
> #  define CL_USE_DEPRECATED_OPENCL_1_1_APIS
> #  include <CL/cl.h>
> #pragma GCC diagnostic pop

> #pragma GCC diagnostic ignored "-Wdeprecated-declarations"

> Note that the "-Wdeprecated-declarations" is not in the push/pop
> section because it needs to be active at the time that deprecated
> functions are used, not at the time that deprecated functions are
> declared with their attribute (ie in <CL/cl.h>)

Oh, cool, thank you!  Learn something new every day.

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: