Preprocessor gcc and override

Discussion in 'C++' started by bigbinc, Jan 2, 2004.

  1. bigbinc

    bigbinc Guest

    I am trying to override all system includes. But I cant be sure that
    they are overridden. I could use #include "stdio.h" as opposed to the
    <stdio.h>
    for example but I am working with a lot of code and have to redo my
    includes.

    So the question, If I have a

    #include <stdio.h> in my code and
    then I do

    gcc -I.my_own_include/(has stdio.h)

    which stdio.h will the code compile with
    /usr/include/stdio.h or

    my_own_include/stdio.h?

    -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 .
    bigbinc, Jan 2, 2004
    #1
    1. Advertising

  2. bigbinc

    Ron Natalie Guest

    "bigbinc" <> wrote in message news:...
    > I am trying to override all system includes. But I cant be sure that
    > they are overridden.


    Where the include files come from is implementation dependent. Redefining
    what is a system library feature is WAY OUTSIDE the realm of the language
    (i.e., as far as the language is concerned, you can't do it).

    You might ask in a gnu.* group covering gcc.
    Ron Natalie, Jan 2, 2004
    #2
    1. Advertising

  3. bigbinc wrote:
    > -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 .


    Directories named with -I are searched first, as the snippit of the info
    page tells you. GCC uses the first file that matches. In future, please
    ask GCC questions in a GCC group.

    Jacques.
    Jacques Labuschagne, Jan 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cronus
    Replies:
    1
    Views:
    643
    Paul Mensonides
    Jul 15, 2004
  2. Replies:
    8
    Views:
    413
  3. GCC Preprocessor

    , May 9, 2006, in forum: C Programming
    Replies:
    8
    Views:
    1,663
    Keith Thompson
    May 9, 2006
  4. Subra

    gcc Preprocessor (-E) with comments

    Subra, Jun 8, 2007, in forum: C Programming
    Replies:
    2
    Views:
    410
    Subra
    Jun 8, 2007
  5. Subra
    Replies:
    7
    Views:
    422
    Subra
    Jul 4, 2007
Loading...

Share This Page