Thread (15 messages) flat view 15 messages, 5 authors, 2002-06-08

Re: can/should we use gcc 3.1 to compile kernels

From: Kevin B. Hendricks <hidden>
Date: 2002-06-07 23:39:44

Hi,

FYI: I counted 1175 occurences of warnings like the following:

inode.c:2462: warning: concatenation of string literals with __FUNCTION__
is deprecated

So I hope someone has a nice sed or awk script to fix all of these in some
automatic way.

Kevin

quoted
quoted
It's not __FUNCTION__ per se that gcc is unhappy about, but string
concatenation with it. So instead of printk ( __FUNCTION__ "text
%d", value) use printk (" %s, text %d", __FUNCTION__, value). No big
deal.

I think current 3.2 already refuses to compile that.
I thought it was 3.1 that gave a big warning about __FUNCTION__ being
depreciated entirely and 3.2 which just removed __FUNCTION__ at all.
Or have things been changed abit?
No, but the warning was always about "string concatenation":
[fsirl@entropy:~]$ cat FUNCTION.c
#include <stdio.h>
int main (void)
{
   printf (__FUNCTION__ " text %d", 5);
   printf ("%s text %d", __FUNCTION__, 5);
   return 0;
}
[fsirl@entropy:~]$ gcc -O2 FUNCTION.c
FUNCTION.c: In function `main':
FUNCTION.c:5: warning: concatenation of string literals with
__FUNCTION__ is deprecated

So, only one warning is issued.

Franz.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help