All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Lee Revell <rlrevell@joe-job.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	"Rickard E. (Rik) Faith" <faith@redhat.com>
Subject: Re: kernel/auditsc.c bug
Date: Fri, 23 Dec 2005 22:28:14 -0500	[thread overview]
Message-ID: <200512232228.14465.dtor_core@ameritech.net> (raw)
In-Reply-To: <1135394240.22177.94.camel@mindpipe>

On Friday 23 December 2005 22:17, Lee Revell wrote:
> gcc 4.0.2 complains that state is (not "may be", is) used initialized on
> line 607:
> 
> 605         list_for_each_entry_rcu(e, &audit_filter_list[AUDIT_FILTER_USER], list) {
> 606                 if (audit_filter_user_rules(cb, &e->rule, &state)) {
> 607                         if (state == AUDIT_DISABLED)
> 608                                 ret = 0;
> 609                         break;
> 610                 }
> 
> AFAICT state will always have been initialized if
> audit_filter_user_rules() returns nonzero:
> 
> 590         switch (rule->action) {
> 591         case AUDIT_NEVER:    *state = AUDIT_DISABLED;       break;
> 592         case AUDIT_POSSIBLE: *state = AUDIT_BUILD_CONTEXT;  break;
> 593         case AUDIT_ALWAYS:   *state = AUDIT_RECORD_CONTEXT; break;
> 594         }
> 595         return 1;
> 
> Is GCC correct that this is a bug (no default case in the switch
> statement)?
>

Well, rule actions are #defines, how can a compiler know that the switch
covers all possible values? If they were enums OTOH...

-- 
Dmitry

      reply	other threads:[~2005-12-24  3:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-24  3:17 kernel/auditsc.c bug Lee Revell
2005-12-24  3:28 ` Dmitry Torokhov [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=200512232228.14465.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=faith@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rlrevell@joe-job.com \
    /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.