2002-10-25 06:22:03

by Jan Marek

[permalink] [raw]
Subject: [miniPATCH][RFC] Compilation fixes in the 2.5.44

Hallo l-k,

I'm beginner in the kernel hacking (or fixing ;-))).

I have small patch, which is fixing some compilation errors (I'm using
gcc-2.95.4-17 from Debian sid).

The first chunk fixed this warning:

arch/i386/kernel/irq.c: In function `do_IRQ':
arch/i386/kernel/irq.c:331: warning: unused variable `esp'

I move declaration of variable esp to the #ifdef blok, where it is
using...

The second chunk fixed this warning:

In file included from arch/i386/kernel/timers/timer_pit.c:15:
arch/i386/mach-generic/do_timer.h: In function `do_timer_interrupt_hook':
arch/i386/mach-generic/do_timer.h:26: warning: implicit declaration of
function `smp_local_timer_interrupt'

I've found, that declaration of function do_timer_interrupt_hook is in
the header asm/apic.h and it is as:

extern void do_timer_interrupt_hook...

Then I add #include of asm/apic.h

The third chunk fixed this error:

net/ipv4/raw.c: In function `raw_send_hdrinc':
net/ipv4/raw.c:297: `NF_IP_LOCAL_OUT' undeclared (first use in this
function)
net/ipv4/raw.c:297: (Each undeclared identifier is reported only once
net/ipv4/raw.c:297: for each function it appears in.)

In this case was missing #include of netfilter_ipv4.h...


Any comments and sugestion is welcome...

Sincerely
Jan Marek
--
Ing. Jan Marek
University of South Bohemia
Academic Computer Centre
Phone: +420-38-7772080


Attachments:
(No filename) (1.33 kB)
fixes.patch (1.56 kB)
Download all attachments

2002-10-25 06:50:35

by Denis Vlasenko

[permalink] [raw]
Subject: Re: [miniPATCH][RFC] Compilation fixes in the 2.5.44

On 25 October 2002 04:28, Jan Marek wrote:
> Hallo l-k,
>
> I'm beginner in the kernel hacking (or fixing ;-))).
>
> I have small patch, which is fixing some compilation errors (I'm
> using gcc-2.95.4-17 from Debian sid).
>
> The first chunk fixed this warning:
>
> arch/i386/kernel/irq.c: In function `do_IRQ':
> arch/i386/kernel/irq.c:331: warning: unused variable `esp'
>
> I move declaration of variable esp to the #ifdef blok, where it is
> using...


unsigned int status;
- long esp;

irq_enter();

#ifdef CONFIG_DEBUG_STACKOVERFLOW
/* Debugging check for stack overflow: is there less than 1KB free? */
+ long esp;

Most C compilers don't allow you to mix declarations and code.
This is allowed only in new C standards. But GCC 3 seems to cope,
so it's probably fine for new kernels.

> The second chunk fixed this warning:
>
> In file included from arch/i386/kernel/timers/timer_pit.c:15:
> arch/i386/mach-generic/do_timer.h: In function
> `do_timer_interrupt_hook': arch/i386/mach-generic/do_timer.h:26:
> warning: implicit declaration of function `smp_local_timer_interrupt'
>
> I've found, that declaration of function do_timer_interrupt_hook is
> in the header asm/apic.h and it is as:
>
> extern void do_timer_interrupt_hook...
>
> Then I add #include of asm/apic.h
>
> The third chunk fixed this error:
>
> net/ipv4/raw.c: In function `raw_send_hdrinc':
> net/ipv4/raw.c:297: `NF_IP_LOCAL_OUT' undeclared (first use in this
> function)
> net/ipv4/raw.c:297: (Each undeclared identifier is reported only once
> net/ipv4/raw.c:297: for each function it appears in.)
>
> In this case was missing #include of netfilter_ipv4.h...

I think #include fixes are best sent to Rusty Trivial Russell.

Rusty Russell <[email protected]> [5 feb 2002]
> Here are some cleanups of whitespace in .....
Want me to add this to the trivial patch collection for tracking?
If so just send (or cc:) it to [email protected].

BTW, never misspell his name, he will be very upset.
He is *Russell*. Note which letters are doubled and which are not. ;)
--
vda

2002-10-25 07:57:43

by Andrey Panin

[permalink] [raw]
Subject: Re: [miniPATCH][RFC] Compilation fixes in the 2.5.44

On Fri, Oct 25, 2002 at 09:44:21AM -0200, Denis Vlasenko wrote:
> On 25 October 2002 04:28, Jan Marek wrote:
> > Hallo l-k,
> >
> > I'm beginner in the kernel hacking (or fixing ;-))).
> >
> > I have small patch, which is fixing some compilation errors (I'm
> > using gcc-2.95.4-17 from Debian sid).
> >
> > The first chunk fixed this warning:
> >
> > arch/i386/kernel/irq.c: In function `do_IRQ':
> > arch/i386/kernel/irq.c:331: warning: unused variable `esp'
> >
> > I move declaration of variable esp to the #ifdef blok, where it is
> > using...
>
>
> unsigned int status;
> - long esp;
>
> irq_enter();
>
> #ifdef CONFIG_DEBUG_STACKOVERFLOW
> /* Debugging check for stack overflow: is there less than 1KB free? */
> + long esp;
>
> Most C compilers don't allow you to mix declarations and code.
> This is allowed only in new C standards. But GCC 3 seems to cope,
> so it's probably fine for new kernels.

This fragment must be fixed, look at Documentation/Changes:

"The recommended compiler for the kernel is gcc 2.95.x (x >= 3)"

Best regards.

--
Andrey Panin | Embedded systems software developer
[email protected] | PGP key: wwwkeys.eu.pgp.net


Attachments:
(No filename) (1.19 kB)
(No filename) (232.00 B)
Download all attachments