This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add a __nowarn__ keyword


[sorry for breaking the thread]

+  if (strcmp (kind_string, "push") == 0)
+    {
+      stack = (diagnostic_stack_entry_t *) xmalloc (sizeof (diagnostic_stack_entry_t));
+      stack->previous = diagnostic_stack;
+      stack->state = diagnostic_save_classifications (global_dc);
+      diagnostic_stack = stack;
+      return;
+    }

If yes, is the "push" necessary? Can we make it implicit?

We could have something like this:


    if (memcmp (kind_string, "push", 4) == 0
        && (kind_string[4] == '\0' || ISSPACE (kind_string[4])))
      {
        ...
        diagnostic_stack = stack;
        kind_string += 4;
        while (ISSPACE (*kind_string))
          kind_string++;
        if (*kind_string == '\0')
          return;
      }

which allows both

#pragma GCC diagnostics push

and

#pragma GCC diagnostics push ignore "-Wcast-qual"

Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]