All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Thomas De Schampheleire <patrickdepinguin+xenomai@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized
Date: Wed, 26 Oct 2011 12:25:59 +0200	[thread overview]
Message-ID: <4EA7E037.2090305@domain.hid> (raw)
In-Reply-To: <c2a2a1a093ea9baee853.1318861193@domain.hid>

On 10/19/2011 09:35 AM, Thomas De Schampheleire wrote:
> Assign default 1 to satisfy compiler (tested with gcc 4.4.3)
>
> Signed-off-by: Thomas De Schampheleire<thomas.de.schampheleire@domain.hid>
> Signed-off-by: Ronny Meeus<ronny.meeus@domain.hid>
>
> ---
>   lib/psos/task.c |  4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/psos/task.c b/lib/psos/task.c
> --- a/lib/psos/task.c
> +++ b/lib/psos/task.c
> @@ -247,7 +247,7 @@ u_long t_create(const char *name, u_long
>   	pthread_attr_t thattr;
>   	struct syncstate syns;
>   	struct service svc;
> -	int ret, cprio;
> +	int ret, cprio = 1;
>   	char short_name[5];
>
>   	ret = check_task_priority(prio,&cprio);
> @@ -414,7 +414,7 @@ u_long t_resume(u_long tid)
>   u_long t_setpri(u_long tid, u_long newprio, u_long *oldprio_r)
>   {
>   	struct psos_task *task;
> -	int ret, cprio;
> +	int ret, cprio = 1;
>
>   	task = get_psos_task_or_self(tid,&ret);
>   	if (task == NULL)
>

Looks like 4.4.3 is wrong, 4.4.4+ does it better and does not choke. 
Just to make sure the optimizer is given a chance to see the truth, 
could you try without this patch, but with tagging check_task_priority() 
as inline instead, with --disable-debug, then with --enable-debug=full 
switches?

TIA,

-- 
Philippe.


  reply	other threads:[~2011-10-26 10:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-19  7:35 [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire
2011-10-19  7:35 ` [Xenomai-help] [PATCH 1 of 4] psos.h: add definition of ERR_OBJTFULL Thomas De Schampheleire
2011-10-26 10:19   ` Philippe Gerum
2011-10-26 10:26     ` Thomas De Schampheleire
2011-10-26 10:33       ` Philippe Gerum
2011-10-26 11:11         ` Thomas De Schampheleire
2011-10-26 12:01           ` Philippe Gerum
2011-10-19  7:35 ` [Xenomai-help] [PATCH 2 of 4] psos: port long_names feature to xenomai-forge Thomas De Schampheleire
2011-10-26 10:21   ` Philippe Gerum
2011-10-26 10:41     ` Thomas De Schampheleire
2011-10-26 11:57       ` Philippe Gerum
2011-10-19  7:35 ` [Xenomai-help] [PATCH 3 of 4] psos: add tm_getm function Thomas De Schampheleire
2011-10-26 10:22   ` Philippe Gerum
2011-10-26 10:42     ` Thomas De Schampheleire
2011-10-19  7:35 ` [Xenomai-help] [PATCH 4 of 4] psos: fix compiler warning: cprio could be used uninitialized Thomas De Schampheleire
2011-10-26 10:25   ` Philippe Gerum [this message]
2011-10-26 11:04     ` Thomas De Schampheleire
2011-10-26 11:58       ` Philippe Gerum
2011-10-26 12:32         ` Thomas De Schampheleire
2011-10-26  9:44 ` [Xenomai-help] [PATCH 0 of 4] xenomai-forge PSOS: miscellaneous fixes Thomas De Schampheleire
2011-10-26 12:47   ` Philippe Gerum
2011-10-26 12:54     ` Thomas De Schampheleire

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=4EA7E037.2090305@domain.hid \
    --to=rpm@xenomai.org \
    --cc=patrickdepinguin+xenomai@domain.hid \
    --cc=xenomai@xenomai.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 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.