Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-18-2008, 06:25 AM   #1
Registered: Dec 2007
Posts: 73

Rep: Reputation: 15
Smile Use of -Wall option in CFLAGS while make for a loadable module

CFLAGS = -Wall -O2 -g -I/usr/nwsdk/include/ -nostdinc -fno-builtin -fpack-struct

this is what we set CFLAGS while making a Makefile ,i read it on different web sources but unable to fully understand the different options like -Wall
If you can give me some tips over this.
Old 01-18-2008, 06:32 AM   #2
Registered: Sep 2004
Location: India
Distribution: Kubuntu, Archlinux, Suse, Gentoo, Mandrake
Posts: 371

Rep: Reputation: 30
-Wall : -W represents warnings. -Wall means it will show all possible warnings.
-O2 : means optimize it. These are used in creating machine code from source code by compiler. There are many levels of optimizing. O2 is generally considered good enough, while O3 makes your file size bigger without optimizing significantly, and may make your program slower on some sort of algorithms.
-g means debug. This will add many debugging "notes" in your final binary, so that when you run a debugger on your final binary file, the debugger will know what part of this binary file is related to which part of the original source code.
-I/path/to/include/files : In C/C++, you can include files which compiler already knows where they are present with command: #include <filename.h>. If the compiler does not know where the include file you want to include is present, you can specify the path to that directory with -I/the/directory

Have a look at "man gcc" everything is there.


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
how to insert a loadable module into the kernel.? moog Linux - Newbie 2 01-08-2007 08:37 AM
Help, loadable kernel module . ERBRMN Linux - General 3 10-13-2006 07:34 AM
ndiswrapper module not loadable quarry_06 Linux - Wireless Networking 9 08-10-2005 08:25 PM
how to add new loadable module to kernel? Mistreated Linux - Software 7 02-02-2005 10:22 AM
loadable kernel module brajesh Linux - General 2 01-17-2003 12:54 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:34 PM.

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