On Fri, Jun 11, 2021 at 4:03 PM Jason Merrill wrote:
> On 6/11/21 3:37 PM, Markus Faehling wrote:
> > Hello,
> >
> > I'm currently facing a problem where I cannot get both gcc and clang
> > warning-free simultaneously in my project. My code looks somewhat like
> > this:
> >
> > class Test {
> >
Here's another #pragma solution to your problem:
class Test {
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpragmas" // so GCC ignores next line
# pragma GCC diagnostic ignored "-Wunused-private-field"
int a_;
# pragma GCC diagnostic pop
void b() {};
};
First tell GCC
On Fri, Jun 11, 2021 at 04:03:34PM -0400, Jason Merrill via Gcc wrote:
> You can use #pragma to disable a warning for a particular section of code:
>
> #pragma GCC diagnostic push
> #pragma GCC diagnostic ignored "-Wattributes"
> class Test {
> [[maybe_unused]] int a_;
> void b() {};
> }
On 6/11/21 3:37 PM, Markus Faehling wrote:
Hello,
I'm currently facing a problem where I cannot get both gcc and clang
warning-free simultaneously in my project. My code looks somewhat like
this:
class Test {
int a_;
void b() {};
};
This code gives me the(usually very useful) "-Wu
On 6/11/21 9:37 PM, Markus Faehling wrote:
Hello,
I'm currently facing a problem where I cannot get both gcc and clang
warning-free simultaneously in my project. My code looks somewhat like
this:
class Test {
int a_;
void b() {};
};
This code gives me the(usually very useful) "-Wunu
Hello,
I'm currently facing a problem where I cannot get both gcc and clang
warning-free simultaneously in my project. My code looks somewhat like this:
class Test {
int a_;
void b() {};
};
This code gives me the(usually very useful) "-Wunused-private-field"
warning on clang. But bec