From: SF Markus Elfring <elfring@users.sourceforge.net>
To: cocci@systeme.lip6.fr
Subject: Re: [PATCH] coccinelle: assign signed result to unsigned variable
Date: Sat, 26 Sep 2015 07:45:15 +0000 [thread overview]
Message-ID: <56064D0B.8060907@users.sourceforge.net> (raw)
In-Reply-To: <56051D2B.5040802@samsung.com>
> Generally I want to catch all assignments of signed function result to unsigned var.
Such a static source code analysis will be useful to some degree.
> In this script I have implemented it this way:
> 1. Look for all assignments 'unsigned = signed' (rs rule).
> 2. Check if signed from rs rule looks as a function call.
I recommend to reconsider a few implementation details because I have got
the impression that this check sequence is inappropriate.
> Is there better way to do it?
I suggest to fix expression weaknesses and a design mistake in this SmPL approach.
I guess that you want to determine functions with a signed return type first
before corresponding variable assignments will be checked further.
* Would you like to collect function names for this purpose by a general analysis
of more source files?
(How do you think about to store them in a dedicated database?)
* Which couple of function calls will be interesting for you?
* Should the search approach take also recursively included files into account?
Regards,
Markus
next prev parent reply other threads:[~2015-09-26 7:45 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1443099286-16559-1-git-send-email-a.hajda@samsung.com>
2015-09-24 15:51 ` [PATCH] coccinelle: assign signed result to unsigned variable SF Markus Elfring
2015-09-25 10:08 ` Andrzej Hajda
2015-09-25 15:51 ` SF Markus Elfring
2015-09-26 7:45 ` SF Markus Elfring [this message]
2015-09-26 9:07 ` Julia Lawall
2015-09-26 9:41 ` SF Markus Elfring
2015-09-26 9:45 ` Julia Lawall
2015-09-26 9:52 ` SF Markus Elfring
2015-09-26 9:55 ` Julia Lawall
2015-09-26 11:43 ` SF Markus Elfring
2015-09-26 13:55 ` Julia Lawall
2015-09-26 15:22 ` SF Markus Elfring
2015-09-26 15:30 ` Julia Lawall
2015-09-26 15:50 ` SF Markus Elfring
2015-09-26 15:55 ` Julia Lawall
2015-09-26 16:01 ` SF Markus Elfring
2015-09-28 10:54 ` [PATCH v2] " Andrzej Hajda
2015-09-28 11:32 ` Julia Lawall
2015-09-28 11:59 ` Andrzej Hajda
2015-09-30 21:51 ` Julia Lawall
2015-09-28 12:07 ` SF Markus Elfring
2015-09-28 12:12 ` Andrzej Hajda
2015-09-28 12:20 ` SF Markus Elfring
2015-09-28 12:42 ` [Cocci] " Julia Lawall
2015-09-28 12:55 ` SF Markus Elfring
2015-09-28 13:13 ` Julia Lawall
2015-09-28 13:53 ` SF Markus Elfring
2015-09-28 15:07 ` Julia Lawall
2015-10-03 7:09 ` Julia Lawall
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=56064D0B.8060907@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--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 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).