This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap 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]

[Bug translator/12137] SDT fails -pedantic with too-long strings


http://sourceware.org/bugzilla/show_bug.cgi?id=12137

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at redhat dot com

--- Comment #11 from Tom Tromey <tromey at redhat dot com> 2011-01-17 14:57:11 UTC ---
(In reply to comment #4)
> Is the compiler supposed to ignore these
> warnings when the macro *expansion* is happening in the user's file?

This is a known gcc bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7263

I think the particular case of __extension__ "overlong string" can be handled
more simply.  This GCC patch seems to fix it for me.

diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index 51df188..b0ef249 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -1045,13 +1045,15 @@ disable_extension_diagnostics (void)
          | (warn_traditional << 2)
          | (flag_iso << 3)
          | (warn_long_long << 4)
-         | (warn_cxx_compat << 5));
+         | (warn_cxx_compat << 5)
+         | (warn_overlength_strings << 6));
   cpp_opts->cpp_pedantic = pedantic = 0;
   warn_pointer_arith = 0;
   cpp_opts->cpp_warn_traditional = warn_traditional = 0;
   flag_iso = 0;
   cpp_opts->cpp_warn_long_long = warn_long_long = 0;
   warn_cxx_compat = 0;
+  warn_overlength_strings = 0;
   return ret;
 }

@@ -1067,6 +1069,7 @@ restore_extension_diagnostics (int flags)
   flag_iso = (flags >> 3) & 1;
   cpp_opts->cpp_warn_long_long = warn_long_long = (flags >> 4) & 1;
   warn_cxx_compat = (flags >> 5) & 1;
+  warn_overlength_strings = (flags >> 6) & 1;
 }

 /* Possibly kinds of declarator to parse.  */

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


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