public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ivan.lazaric.gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/109988] New: -iwithprefix doesn't add folder to end of search list
Date: Fri, 26 May 2023 12:42:47 +0000	[thread overview]
Message-ID: <bug-109988-4@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109988

            Bug ID: 109988
           Summary: -iwithprefix doesn't add folder to end of search list
           Product: gcc
           Version: 11.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ivan.lazaric.gcc at gmail dot com
  Target Milestone: ---

```
echo | g++ -iprefix "./" -iwithprefix "."  -E -v -
```

Snippet of output:
```
#include <...> search starts here:
 ./.
 /usr/lib/gcc/x86_64-linux-gnu/11/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
```

Issue is that "./." is at the front of the list, should be at bottom.

Snippet of `man g++`:
```
-iprefix prefix
           Specify prefix as the prefix for subsequent -iwithprefix options. 
If the prefix
           represents a directory, you should include the final /.

       -iwithprefix dir
       -iwithprefixbefore dir
           Append dir to the prefix specified previously with -iprefix, and add
the
           resulting directory to the include search path.  -iwithprefixbefore
puts it in
           the same place -I would; -iwithprefix puts it where -idirafter
would.
```

^ implying `-iwithprefix` should behave like `-idirafter`

`echo | g++ -idirafter "./." -E -v -`:
```
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/11/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
 ./.
End of search list.
```

Related to: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=34502

             reply	other threads:[~2023-05-26 12:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 12:42 ivan.lazaric.gcc at gmail dot com [this message]
2023-05-26 13:22 ` [Bug c++/109988] " ivan.lazaric.gcc at gmail dot com
2023-05-26 17:42 ` [Bug preprocessor/109988] " pinskia at gcc dot gnu.org
2023-05-27  0:42 ` ivan.lazaric.gcc at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109988-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).