lkml.org 
[lkml]   [2011]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH][RFC] Sparc: Remove trigraph in die_if_kernel() message.
On Thu, 9 Jun 2011, David Miller wrote:

> From: Al Viro <viro@ZenIV.linux.org.uk>
> Date: Fri, 10 Jun 2011 00:03:22 +0100
>
> > On Thu, Jun 09, 2011 at 03:59:43PM -0700, David Miller wrote:
> >> > If I'm not mistaken, that "??!" will be taken as a trigraph for "|" by the
> >> > preprocessor, so the final string will end up either as
> >> > "Penguin instruction from Penguin mode|?!"
> >
> > Not without -trigraphs, which is not on by default...
>
> Oh, in that case I'll rever this.
>

Well, my gcc warns about it. It seems that -Wtrigraphs is enabled by
default:

[jj@dragon src]$ gcc --version
gcc (GCC) 4.6.0 20110603 (prerelease)
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

[jj@dragon src]$ cat test.c
#include <stdio.h>

int main()
{
printf("Penguin instruction from Penguin mode??!?!");
return 0;
}
[jj@dragon src]$ gcc test.c
test.c: In function ‘main’:
test.c:5:48: warning: trigraph ??! ignored, use -trigraphs to enable [-Wtrigraphs]


Which was why I wrote in my original submission mail :

"... which I assume is not what we want, or as the correct string but with
a warning about an ignored trigraph which I assume we don't want either."

So either we get the wrong string (if someone enables -trigraphs) or we
get a warning (at least with newer gcc's). Which is why I felt the patch
made sense as a way to avoid both unfortunate results.

--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
\
 
 \ /
  Last update: 2011-06-10 10:01    [W:0.058 / U:1.968 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site