From: Andrew Morton <akpm@linux-foundation.org>
To: "Uwe Kleine-König" <uwe@kleine-koenig.org>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>,
linux-kernel@vger.kernel.org, Greg KH <greg@kroah.com>
Subject: Re: [PATCH] telephony/ixj: Fix warning about sequence points
Date: Thu, 22 Mar 2012 16:03:36 -0700 [thread overview]
Message-ID: <20120322160336.66e9a88b.akpm@linux-foundation.org> (raw)
In-Reply-To: <1332154664-10968-1-git-send-email-uwe@kleine-koenig.org>
On Mon, 19 Mar 2012 11:57:44 +0100
Uwe Kleine-K__nig <uwe@kleine-koenig.org> wrote:
> In the statement
>
> j->caplist[j->caps].handle = j->caps++;
>
> there is no sequence point between the usage of j->caps on the LHS of the
> assignment and the incrementation on its RHS. So it's not defined in Standard C
> if j->caps is already incremented when used on the LHS even though the postfix
> ++ operator is used. To properly fix that the incrementation has to be done in
> a seperate expression.
>
> This fixes:
> drivers/telephony/ixj.c: In function ___add_caps___:
> drivers/telephony/ixj.c:5930:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5950:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5954:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5965:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5976:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5988:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:5998:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6003:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6008:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6013:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6019:38: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6026:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6031:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6036:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6041:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6049:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6057:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6065:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
> drivers/telephony/ixj.c:6071:39: warning: operation on ___j->caps___ may be undefined [-Wsequence-point]
>
> Signed-off-by: Uwe Kleine-K__nig <uwe@kleine-koenig.org>
> ---
> drivers/telephony/ixj.c | 57 +++++++++++++++++++++++++++++++---------------
fyi, ixj.c has been moved into staging/, with a view to removing it
altogether.
It will be sad to see it go - it has stood as a great example of what not
to do ;) And no, I don't now how to find out if anyone is using it either.
prev parent reply other threads:[~2012-03-22 23:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-19 10:57 Uwe Kleine-König
2012-03-22 23:03 ` Andrew Morton [this message]
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=20120322160336.66e9a88b.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@profusion.mobi \
--cc=uwe@kleine-koenig.org \
/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
Powered by JetHome