[Bug driver/126506] New: gcc.cc: Only define add_sysrooted_hdrs_prefix if NATIVE_SYSTEM_HEADER_DIR is defined

dragon-archer at outlook dot com via Gcc-bugs <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126506

            Bug ID: 126506
           Summary: gcc.cc: Only define add_sysrooted_hdrs_prefix if
                    NATIVE_SYSTEM_HEADER_DIR is defined
           Product: gcc
           Version: 16.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dragon-archer at outlook dot com
  Target Milestone: ---

`add_sysrooted_hdrs_prefix` is only used in `find_fortran_preinclude_file` when
NATIVE_SYSTEM_HEADER_DIR is defined, while itself is defined unconditionally.
This generates the following warning when compiling GCC with
NATIVE_SYSTEM_HEADER_DIR not defined (e.g. on MinGW-w64):

../../gcc-16.1.0/gcc/gcc.cc:3231:1: warning: 'void
add_sysrooted_hdrs_prefix(path_prefix*, const char*, const char*, int, int,
int)' defined but not used [-Wunused-function]
 3231 | add_sysrooted_hdrs_prefix (struct path_prefix *pprefix, const char
*prefix,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.