All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Whitcroft <apw@shadowen.org>
To: penguin-kernel@i-love.sakura.ne.jp
Cc: rdunlap@xenotime.net, jschopp@austin.ibm.com,
	linux-kernel@vger.kernel.org
Subject: Re: */ in string confuses checkpatch.pl
Date: Wed, 22 Oct 2008 08:56:17 +0100	[thread overview]
Message-ID: <20081022075617.GA22344@brain> (raw)
In-Reply-To: <200810210057.m9L0vQ7i012829@www262.sakura.ne.jp>

On Tue, Oct 21, 2008 at 09:57:26AM +0900, penguin-kernel@i-love.sakura.ne.jp wrote:
> Hello.
> 
> The below code confuses checkpatch.pl ver 0.21.
> 
> Regards.
> ----------
> # cat /tmp/foo.c
> void foo(void)
> {
> 	bar(\" /proc/\\\\*/\");
> 	bar(\" /proc/\\\\$/\");
> }
> # /usr/src/vanilla/linux-2.6.27.2/scripts/checkpatch.pl --file /tmp/foo.c
> ERROR: need consistent spacing around \'/\' (ctx:WxV)
> #4: FILE: tmp/foo.c:4:
> +       bar(\" /proc/\\\\$/\");
>               ^
> 
> total: 1 errors, 0 warnings, 5 lines checked
> 
> /tmp/foo.c has style problems, please review.  If any of these errors
> are false positives report them to the maintainer, see
> CHECKPATCH in MAINTAINERS.

I am unable to reproduce this here with any version from current back to
v0.19, nor with the one I find in v2.6.27.2 (see below).  Though looking at
the code as presented in your example I can see how it might be interpreted
incorrectly.  That said the compiler doesn't seem to be able to understand
this either (also below).  In particular you effectivly open a quote on
the third line and never close it.

Could you send me both the checkpatch script and the foo.c as attachments
so I can be sure I have them without some emailer somewhere mushing
them up.

Thanks for you report.

-apw

$ cat ../checkpatch/Z213.c
void foo(void)
{
	bar(\" /proc/\\\\*/\");
	bar(\" /proc/\\\\$/\");
}
$ cc -c Z213.c
Z213.c: In function ‘foo’:
Z213.c:3: error: stray ‘\’ in program
Z213.c:3:7: warning: missing terminating " character
Z213.c:3: error: missing terminating " character
Z213.c:4: error: stray ‘\’ in program
Z213.c:4:7: warning: missing terminating " character
Z213.c:4: error: missing terminating " character
Z213.c:5: error: expected expression before ‘}’ token
Z213.c:5: error: expected ‘)’ before ‘}’ token
Z213.c:5: error: expected ‘;’ before ‘}’ token

$ git checkout v2.6.27.2
HEAD is now at 6bcd6d7... Linux 2.6.27.2
apw@brain$ ./scripts/checkpatch.pl  --file ../checkpatch/Z213.c
total: 0 errors, 0 warnings, 5 lines checked

../checkpatch/Z213.c has no obvious style problems and is ready for submission.
$

  reply	other threads:[~2008-10-22  7:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-21  0:57 */ in string confuses checkpatch.pl penguin-kernel
2008-10-22  7:56 ` Andy Whitcroft [this message]
2008-10-22  8:02   ` Tetsuo Handa
2008-10-22  8:31   ` Andy Whitcroft
2008-10-22 11:21     ` Tetsuo Handa
2008-10-23 11:27       ` [checkpatch.pl] two bugs Tetsuo Handa
2008-10-23 11:54         ` Andy Whitcroft

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=20081022075617.GA22344@brain \
    --to=apw@shadowen.org \
    --cc=jschopp@austin.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=rdunlap@xenotime.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.