Grant Edwards schrieb:
On 2006-03-18, Grant Edwards <gra...@visi.com> wrote:


the deprecation warning switches of the compiler have no
influlence on this one so there is no easy way to get rid of
the warning.

I'm going to have a go at patching the compiler to get rid of
it either altogether,


I'm lazy, so I just disabled that warning completely.  Here's
the patch agains gcc 3.2.whatever.

i've scanned the gcc sources and docs and found that
  #pragma GCC system_header
sets the "in_system_header" variable seen in th ecode below.
however, that does not help directly in our case, as the "system header" tag is not carried along with the function like macro.

it however switches the warning if you put it in the source file (or include it within the _BIC_SR_IRQ macro using _Pragma("...")). but it also disables all the warnings for the rest of the file, after the macro is used :-(

i guess the patch isn't that bad. i'll probably include it for future releases.

chris

------------------------------8<------------------------------
diff -U8 -r ./gcc/c-common.c ../../patched/gcc-3.2.3/gcc/c-common.c
--- ./gcc/c-common.c    2002-12-01 12:19:08.000000000 -0600
+++ ../../patched/gcc-3.2.3/gcc/c-common.c      2006-03-18 22:08:27.000000000 
-0600
@@ -581,18 +581,20 @@
          if (TREE_TYPE (t) == wchar_array_type_node)
            {
              wide_length += (TREE_STRING_LENGTH (t) - wchar_bytes);
              wide_flag = 1;
            }
          else
            {
              length += (TREE_STRING_LENGTH (t) - 1);
+#if 0 if (C_ARTIFICIAL_STRING_P (t) && !in_system_header) warning ("concatenation of string literals with __FUNCTION__ is deprecated"); +#endif
            }
        }
/* If anything is wide, the non-wides will be converted,
         which makes them take more space.  */
       if (wide_flag)
        length = length * wchar_bytes + wide_length;
------------------------------8<------------------------------



Reply via email to