From: devel.fx.lebail@orange.fr (Francois-Xavier Le Bail)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Question about a not made change
Date: Sat, 25 Nov 2017 08:38:09 +0100 [thread overview]
Message-ID: <d45758b3-f6cb-dc3a-0be2-c0b282aa9be9@orange.fr> (raw)
Hi,
I try the following patch:
-----
@@
u_char *p;
expression n;
@@
ND_PRINT(
...,
-p[n]
+EXTRACT_U_1(p + n)
)
-----
on the following (minimized) code:
-----
int main()
{
u_char *p;
ND_PRINT(ndo, ": %02x %02x", p[1], p[2]);
return 0;
}
-----
I got:
-----
+++ /tmp/cocci-output-1795-a34831-main.c
@@ -1,7 +1,7 @@
int main()
{
u_char *p;
- ND_PRINT(ndo, ": %02x %02x", p[1], p[2]);
+ ND_PRINT(ndo, ": %02x %02x", p[1], EXTRACT_U_1(p + 2));
return 0;
}
-----
Why the first p[1] is not change to EXTRACT_U_1(p + 1)?
Did I miss something obvious?
--
Francois-Xavier
next reply other threads:[~2017-11-25 7:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-25 7:38 Francois-Xavier Le Bail [this message]
2017-11-25 7:44 ` [Cocci] Question about a not made change Julia Lawall
2017-11-25 7:54 ` Francois-Xavier Le Bail
2017-11-25 12:26 ` Francois-Xavier Le Bail
2017-11-25 13:32 ` Julia Lawall
2017-11-27 9:49 ` Francois-Xavier Le Bail
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=d45758b3-f6cb-dc3a-0be2-c0b282aa9be9@orange.fr \
--to=devel.fx.lebail@orange.fr \
--cc=cocci@systeme.lip6.fr \
/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.