GCC directory option -isystem

后端 未结 1 2082
萌比男神i
萌比男神i 2020-12-15 20:39

From this link: http://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html

If a standard system include directory, or a directory specified with -is

1条回答
  •  悲哀的现实
    2020-12-15 21:06

    The documentation says:

    -isystem dir

    Search dir for header files, after all directories specified by -I but before the standard system directories. Mark it as a system directory, so that it gets the same special treatment as is applied to the standard system directories. If dir begins with =, then the = will be replaced by the sysroot prefix; see --sysroot and -isysroot.

    So you're using it wrong. You need to specify a directory for the -isystem option itself, it doesn't work like a "modifier" of the -I option like you seem to be trying.

    I believe your command should be:

    $ gcc -isystem ../include hello.c
    

    System headers get special treatment w.r.t. warnings (since they are read only, and some cannot be written in strictly conforming code)

    0 讨论(0)
提交回复
热议问题