views:

24

answers:

2

Hi All

This question may be pretty simple, but i dont find exact answers ..

in shell script i have a line like this,

export CFLAGS=" -w -Iinc/ -Isrc/"

I dont know what is that -w and -I options doing here??

All i know is this line includes the directories inc and src

Any help would be great

A: 

They're arguments to your compiler. If gcc, then:

  • -w: Inhibit all warning messages.
  • -I: Add the directory dir to the list of directories to be searched for header files. Directories named by '-I' are searched before the standard system include directories. If the directory dir is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system headers are not defeated (see System Headers).
Michael Petrotta
+2  A: 

This just sets an environment variable. I'm guessing that it gets used to set flags for GCC.

From man gcc:

   -I dir
       Add the directory dir to the list of directories to be searched for
       header files.  Directories named by -I are searched before the
       standard system include directories.  If the directory dir is a
       standard system include directory, the option is ignored to ensure
       that the default search order for system directories and the
       special treatment of system headers are not defeated .

   -w  Suppress all warnings, including those which GNU CPP issues by
       default.
David Dorward
thank you .....
Praveen