LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-13-2009, 12:33 PM   #1
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Rep: Reputation: 16
Warnings during Kernel Compilation


Hi there !

Every time I compile a new kernel (from source) under ubuntu 9.04, I get a series of annoying warnings like:

scripts/mod/modpost.c: In function ‘get_markers’:
scripts/mod/modpost.c:1542: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
scripts/mod/modpost.c: In function ‘add_marker’:
scripts/mod/modpost.c:1962: warning: ignoring return value of ‘asprintf’, declared with attribute warn_unused_result
scripts/kallsyms.c: In function ‘read_symbol’:
scripts/kallsyms.c:74: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
init/main.c: In function ‘start_kernel’:
init/main.c:571: warning: format not a string literal and no format arguments
init/initramfs.c: In function ‘populate_rootfs’:
init/initramfs.c:581: warning: format not a string literal and no format arguments
arch/x86/kernel/dumpstack_64.c: In function ‘print_trace_warning_symbol’:
arch/x86/kernel/dumpstack_64.c:254: warning: format not a string literal and no format arguments
arch/x86/kernel/dumpstack_64.c: In function ‘print_trace_address’:
arch/x86/kernel/dumpstack_64.c:276: warning: format not a string literal and no format arguments
...

I guess this is normal, since my compiled kernel, after installation works fine!

I found a way to get rid of this warnings by redirecting the standard error e.g 2> /dev/null or 2> some_file. But both these ways have the disadvantage that I can't tell which one of those warnings might be critical...
Are there any "flags" to use with make-kpkg in order to output only the critical warnings, and not all of this ?

P.S. When I compile the same source under Debian Lenny, none of these warnings appear. Why?


Regards
Vas
 
Old 06-13-2009, 12:39 PM   #2
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Kernel version? Where did you get the sources? Strictly speaking, these are just indicative of poor programming, or a minor issue.

Make sure you're using the correct kernel and uptodate code
 
Old 06-13-2009, 01:25 PM   #3
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jamescondron View Post
Kernel version? Where did you get the sources? Strictly speaking, these are just indicative of poor programming, or a minor issue.

Make sure you're using the correct kernel and uptodate code
Hi james!

I got the sources from http://www.kernel.org
kernel version 2.6.28.10 This is the last one of the 2.6.28 series right ?

file: linux-2.6.28.10.tar.bz2

It is the official, trust me.
This is the exact location of the source...
ftp://ftp.kernel.org/pub/linux/kernel/v2.6/

Maybe in low-level programming with so many independent modules such warnings are possible ...

Look at this (over-simplified) example to see what I mean..

int foo(int x) {

int result;

if(x==0) result= 15;
if(x==1) result=-15;

return result;
}

Let x represents e.g an event!

the programmer knows in advance that x variable can take only two possible values, 0 and 1 but the compiler doesn't. Because variable result is not initialized in function foo() the compiler might complain. But the code (from the programers perspective) is correct!

The question is how to avoid getting all these messy warnings, and project only the serious ones (if they ever occured)?

Vas

Last edited by vasmakk; 06-13-2009 at 01:31 PM.
 
Old 06-13-2009, 01:34 PM   #4
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Try 26.6.30; When I built that yesterday no errors occurred. And yes, I am well aware of what the warnings are saying, but kernel code is usually clean as... well... kernel code really; you should have no compilation warnings in kernel code.

That being said, take a look at the patch between kernel versions for
arch/x86/kernel/dumpstack_64.c
Not exactly brilliant code there.( http://www.linuxhq.com/kernel/v2.6/2...dumpstack_64.c )

But yes, try the upto date kernel
 
Old 06-13-2009, 02:01 PM   #5
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jamescondron View Post
Try 26.6.30; When I built that yesterday no errors occurred. And yes, I am well aware of what the warnings are saying, but kernel code is usually clean as... well... kernel code really; you should have no compilation warnings in kernel code...
Yes, that is what I think too ...
Thanks my friend! I'll try 26.6.30 (you mean 2.6.30 ?)

P.S. I've noticed you are using Debian Lenny right ? In Debian the compilation is clean and crystal clear... It is in ubuntu 9.04 where I get all these warnings


Regards
Vas

Last edited by vasmakk; 06-13-2009 at 02:06 PM.
 
Old 06-13-2009, 02:05 PM   #6
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Well, remember all those hoops you had to jump through to even be able to get to building a kernel in ubuntu? Thats because ubuntu don't really want you to compile your own; so this could be related.

Of course, I'm guessing here
 
Old 06-13-2009, 02:13 PM   #7
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jamescondron View Post
Well, remember all those hoops you had to jump through to even be able to get to building a kernel in ubuntu? Thats because ubuntu don't really want you to compile your own; so this could be related.

Of course, I'm guessing here
Actually I'm new to Linux and certainly I've missed episodes!

I am basically a Debian fun... But now with ubuntu 9.04 I thought I could try my luck at this distro also... I saw some interesting characteristics and impressed. But why this should be so different? After all It is based on Debian

P.S. Ubuntu learned me how to compile a kernel... After the first installation the original kernel were droping me into ramdisk. I had to type > modprobe usb_storage and >exit every time to proceed ... ha, ha


Vas

Last edited by vasmakk; 06-13-2009 at 02:16 PM.
 
Old 06-13-2009, 02:21 PM   #8
jamescondron
Member
 
Registered: Jul 2007
Location: Scunthorpe, UK
Distribution: Ubuntu 8.10; Gentoo; Debian Lenny
Posts: 961

Rep: Reputation: 69
Because of the target audience; Ubuntu is, almost completely by philosophy, designed for new users, or users with little or no technical experience. This in mind, they package kernels up for the end user so they wont have to worry about kernel compilation.

This why to compile a kernel on Ubuntu you can't just jump into /usr/src and have a go, you have to install all the development tools first, then set up the environment, then compile everything from scratch.
 
Old 06-13-2009, 03:05 PM   #9
vasmakk
Member
 
Registered: Jan 2009
Distribution: Debian Lenny, Ubuntu 9.04
Posts: 87

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by jamescondron View Post
Because of the target audience; Ubuntu is, almost completely by philosophy, designed for new users, or users with little or no technical experience. This in mind, they package kernels up for the end user so they wont have to worry about kernel compilation.

This why to compile a kernel on Ubuntu you can't just jump into /usr/src and have a go, you have to install all the development tools first, then set up the environment, then compile everything from scratch.
Yes I know... I followed the instructions of this
http://www.howtoforge.com/kernel_compilation_ubuntu
as well as many similar tutorials (even the traditional way!) before I proceed...

Actually the only change I made to the original .config file was the support of build in usb-storage (USB_STORAGE=y) and build in vesa support (FB_VESA=y). to avoid the problem I pre mentioned, and because I want a system independent of Graphics Cards (portable) ...

Vas
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
deprecated function warnings on compilation stabu Programming 3 01-19-2009 10:46 AM
Warnings during 2.6.25 kernel compilation sugantha Linux - Newbie 3 09-30-2008 11:52 AM
warnings by library compilation halturata Programming 5 07-10-2006 04:07 PM
LXer: Linux: Kernel Compilation Warnings LXer Syndicated Linux News 0 05-12-2006 08:21 AM
warnings during compilation HmmLinux Linux - General 8 12-22-2005 02:16 PM


All times are GMT -5. The time now is 08:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration