LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 10-15-2010, 08:26 AM   #1
T. Jump
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Rep: Reputation: 0
How to handle warnings


I've been trying to understand issues that occur during a uClinux distribution build (so I can include such issues in a module I'm writing for students). My process has been to work through errors that occur due to missing packages, then remove the distribution and build it again to uncover what happens.

One thing I notice is different sets of warnings within each iteration of making a new build. From the document here (http://docs.blackfin.uclinux.org/dok...d=optimization) it states, "A typical warning involves a variable being used before its value has been set."

So my question: is there a way to verify that the issue throwing the warning has been resolved by the end of the make build?

And, is running make build again an option or could this cause problems within the build directories or image?

Thanks for any information you can share.
 
Old 10-15-2010, 10:40 AM   #2
Stephen R. Besch
LQ Newbie
 
Registered: Apr 2008
Distribution: Linux Mint
Posts: 20

Rep: Reputation: 4
This is a very general answer, but I hope it helps. Warnings are just that - warnings. Usually they result from either sloppy programming or from using programming constructs that were once perfectly legal but which have become "deprecated" in a newer version of a compiler. For the most part, you can ignore them when they are in someone else's code. They may become errors in the future, if for example a deprecated feature of the compiler is removed in a future release. In your own code, you should probably try to resolve them, simply in the interest of best practices.

Quote:
Is there a way to verify that the issue throwing the warning has been resolved by the end of the make build?
Warnings usually don't go away by themselves. You need to open the source file and look at the offending line. Sometimes, the problem is obvious, sometimes not. Fixing the issue in the source and re-compiling is the only way to get rid of the warning. With regard to running a second make, I've never found this to be a problem. Sometimes make clean is needed. Also, if you've run a make install, you may need to do make uninstall first. However, I have occasionally found Makefiles that don't have a make clean or make uninstall target. Hope this helps.
 
Old 10-15-2010, 10:49 AM   #3
T. Jump
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Great. This is exactly what I was trying to understand. Thank you for the clean reply.
 
Old 10-17-2010, 10:45 AM   #4
T. Jump
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
I thought I would reopen this as I did finally just redo the make build to see what would happen and viola, none of the warnings or single error occurred on the second pass. I've tried to attach the scripts from both make build 1/make build 1 warnings and make build 2/make build 2 warnings but they are too big.

So again, I'm trying to understand what is happening during the make build that caused the warnings to throw on attempt one but not on attempt 2. I think this is clear per the previous discussion but I'm into running redundant checks to verify results so any new or confirmation explanations are appreciated.

Thanks,
T. Jump

Last edited by T. Jump; 10-17-2010 at 11:35 AM.
 
Old 10-17-2010, 11:35 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,298

Rep: Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164Reputation: 3164
Quote:
I've tried to attach the scripts but I don't see my attachments
Files not having suffix .txt are ignored.

( All kind of files can be uploaded, e.g. make.logs.tar.gz :
Just rename to make.logs.tar.gz.txt ).

..
 
Old 10-17-2010, 05:11 PM   #6
Stephen R. Besch
LQ Newbie
 
Registered: Apr 2008
Distribution: Linux Mint
Posts: 20

Rep: Reputation: 4
Quote:
I did finally just redo the make build to see what would happen and viola, none of the warnings or single error occurred on the second pass.
I can't say for sure, but one possibility is this: Unless you "make clean", the results of the previous compilation (that is, the output object files) will still be hanging around. Because of the way in which the make system looks at file timestamps to determine whether or not a file needs to be recompiled or not, it is just possible that the offending files were skipped for recompilation because there was already a compiled object and the source files had not been changed. If they weren't recompiled, then warnings would not appear.

This warrants a little more explanation. Since projects can take a long time to build, it is generally the case that only parts of the project that need recompilation will in fact be recompiled. The Make system deals with this by looking at each source file, and any files that they depend upon, to see if they have changed since the last make. If they have not, and there is already a suitable output file for the source, then recompilation is skipped. It really saves a lot of time for the developers! The make file output should indicate if this is the case.

Errors are another matter. Depending upon how the compiler options are set, Errors can terminate a compile/build. Another make should trip up on the same error. Typically, but not always, the compiler options are set to trap most (but not necessarily all) errors.

Hope this helps
 
Old 10-18-2010, 06:15 PM   #7
T. Jump
LQ Newbie
 
Registered: Oct 2010
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks. This helps a lot.
 
  


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
menuconfig warnings aquaboot Debian 2 07-04-2008 02:09 AM
c warnings kpachopoulos Programming 1 08-25-2006 06:45 AM
tar warnings early Linux - General 2 01-05-2006 08:57 PM
What do these warnings mean (re cdrom)? tigerflag Linux - Hardware 4 03-24-2005 06:14 PM
removing warnings h/w Programming 6 01-26-2004 05:06 PM


All times are GMT -5. The time now is 09:51 AM.

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