From: Andrew Lunn <andrew@lunn.ch>
To: David Laight <David.Laight@ACULAB.COM>
Cc: Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH net-next 2/2] net: rose: Escape trigraph to fix warning with W=1
Date: Thu, 29 Oct 2020 15:31:21 +0100 [thread overview]
Message-ID: <20201029143121.GN878328@lunn.ch> (raw)
In-Reply-To: <294bfee65035493fac1e2643a5e360d5@AcuMS.aculab.com>
On Thu, Oct 29, 2020 at 02:19:27PM +0000, David Laight wrote:
> From: Andrew Lunn
> > Sent: 28 October 2020 00:23
> >
> > net/rose/af_rose.c: In function ‘rose_info_show’:
> > net/rose/af_rose.c:1413:20: warning: trigraph ??- ignored, use -trigraphs to enable [-Wtrigraphs]
> > 1413 | callsign = "??????-?";
> >
> > ??- is a trigraph, and should be replaced by a ˜ by the
> > compiler. However, trigraphs are being ignored in the build. Fix the
> > warning by escaping the ?? prefix of a trigraph.
> >
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> > net/rose/af_rose.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c
> > index cf7d974e0f61..2c297834d268 100644
> > --- a/net/rose/af_rose.c
> > +++ b/net/rose/af_rose.c
> > @@ -1410,7 +1410,7 @@ static int rose_info_show(struct seq_file *seq, void *v)
> > ax2asc(buf, &rose->dest_call));
> >
> > if (ax25cmp(&rose->source_call, &null_ax25_address) == 0)
> > - callsign = "??????-?";
> > + callsign = "????\?\?-?";
>
> I think I'd just split the string, eg: "?????" "-?".
Humm. I think we need a language lawyer.
Does it concatenate the strings and then evaluate for trigraphs? Or
does it evaluate for trigraphs, and then concatenate the strings?
Andrew
next prev parent reply other threads:[~2020-10-29 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 0:22 [PATCH net-next 0/2] net trigraph fixes for W=1 Andrew Lunn
2020-10-28 0:22 ` [PATCH net-next 1/2] net: marvell: mvneta: Fix trigraph warning with W=1 Andrew Lunn
2020-10-28 0:22 ` [PATCH net-next 2/2] net: rose: Escape trigraph to fix " Andrew Lunn
2020-10-29 14:19 ` David Laight
2020-10-29 14:31 ` Andrew Lunn [this message]
2020-10-29 14:52 ` David Laight
2020-10-29 15:13 ` Andrew Lunn
2020-10-29 15:29 ` Arnd Bergmann
2020-10-29 21:47 ` [PATCH net-next 0/2] net trigraph fixes for W=1 Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201029143121.GN878328@lunn.ch \
--to=andrew@lunn.ch \
--cc=David.Laight@ACULAB.COM \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=ralf@linux-mips.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).