public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
@ 2012-08-31  8:00 ` asierllano at gmail dot com
  2012-08-31  8:04 ` asierllano at gmail dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: asierllano at gmail dot com @ 2012-08-31  8:00 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579

Asier Llano <asierllano at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asierllano at gmail dot com

--- Comment #5 from Asier Llano <asierllano at gmail dot com> 2012-08-31 08:00:09 UTC ---
We have a similar issue for embedded devices with debugging. We even
implemented it with the same exact name __FILE_BASENAME__ and when I was going
to submit a it in bugzilla we realized that it was already reported.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
  2012-08-31  8:00 ` [Bug c/42579] [PATCH] support for obtaining file basename asierllano at gmail dot com
@ 2012-08-31  8:04 ` asierllano at gmail dot com
  2021-05-20  8:13 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: asierllano at gmail dot com @ 2012-08-31  8:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579

--- Comment #6 from Asier Llano <asierllano at gmail dot com> 2012-08-31 08:03:58 UTC ---
We tried it in 4.7 and it works perfectly. By now we will have to apply this
patch for our development with 4.7.1.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
  2012-08-31  8:00 ` [Bug c/42579] [PATCH] support for obtaining file basename asierllano at gmail dot com
  2012-08-31  8:04 ` asierllano at gmail dot com
@ 2021-05-20  8:13 ` cvs-commit at gcc dot gnu.org
  2021-05-20  8:14 ` clyon at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-05-20  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:

https://gcc.gnu.org/g:1a9b3f04c11eb467a8dc504a37dad57a371a0d4c

commit r12-938-g1a9b3f04c11eb467a8dc504a37dad57a371a0d4c
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Thu May 20 08:10:50 2021 +0000

    c: Add support for __FILE_NAME__ macro (PR c/42579)

    The toolchain provided by ST for stm32 has had support for
    __FILENAME__ for a while, but clang/llvm has recently implemented
    support for __FILE_NAME__, so it seems better to use the same macro
    name in GCC.

    It happens that the ST patch is similar to the one proposed in PR
    c/42579.

    Given these input files:
    ::::::::::::::
    mydir/myinc.h
    ::::::::::::::
    char* mystringh_file = __FILE__;
    char* mystringh_filename = __FILE_NAME__;
    char* mystringh_base_file = __BASE_FILE__;
    ::::::::::::::
    mydir/mysrc.c
    ::::::::::::::

    char* mystring_file = __FILE__;
    char* mystring_filename = __FILE_NAME__;
    char* mystring_base_file = __BASE_FILE__;

    we produce:
    $ gcc mydir/mysrc.c -I . -E
    char* mystringh_file = "./mydir/myinc.h";
    char* mystringh_filename = "myinc.h";
    char* mystringh_base_file = "mydir/mysrc.c";

    char* mystring_file = "mydir/mysrc.c";
    char* mystring_filename = "mysrc.c";
    char* mystring_base_file = "mydir/mysrc.c";

    2021-05-20  Christophe Lyon  <christophe.lyon@linaro.org>
                Torbjörn Svensson  <torbjorn.svensson@st.com>

            PR c/42579
            libcpp/
            * include/cpplib.h (cpp_builtin_type): Add BT_FILE_NAME entry.
            * init.c (builtin_array): Likewise.
            * macro.c (_cpp_builtin_macro_text): Add support for BT_FILE_NAME.

            gcc/
            * doc/cpp.texi (Common Predefined Macros): Document __FILE_NAME__.

            gcc/testsuite/
            * c-c++-common/spellcheck-reserved.c: Add tests for __FILE_NAME__.
            * c-c++-common/cpp/file-name-1.c: New test.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-05-20  8:13 ` cvs-commit at gcc dot gnu.org
@ 2021-05-20  8:14 ` clyon at gcc dot gnu.org
  2021-05-31 16:17 ` rdiezmail-gcc at yahoo dot de
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 11+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-05-20  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |clyon at gcc dot gnu.org

--- Comment #10 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Fixed on trunk: we now support __FILE_NAME__, like clang.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-05-20  8:14 ` clyon at gcc dot gnu.org
@ 2021-05-31 16:17 ` rdiezmail-gcc at yahoo dot de
  2021-05-31 16:20 ` rdiezmail-gcc at yahoo dot de
  2021-06-01  7:44 ` clyon at gcc dot gnu.org
  6 siblings, 0 replies; 11+ messages in thread
From: rdiezmail-gcc at yahoo dot de @ 2021-05-31 16:17 UTC (permalink / raw)
  To: gcc-bugs

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

R. Diez <rdiezmail-gcc at yahoo dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rdiezmail-gcc at yahoo dot de

--- Comment #11 from R. Diez <rdiezmail-gcc at yahoo dot de> ---
What is the target GCC version for __FILE_NAME__? GCC 12.1?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-05-31 16:17 ` rdiezmail-gcc at yahoo dot de
@ 2021-05-31 16:20 ` rdiezmail-gcc at yahoo dot de
  2021-06-01  7:44 ` clyon at gcc dot gnu.org
  6 siblings, 0 replies; 11+ messages in thread
From: rdiezmail-gcc at yahoo dot de @ 2021-05-31 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from R. Diez <rdiezmail-gcc at yahoo dot de> ---
*** Bug 77488 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
       [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-05-31 16:20 ` rdiezmail-gcc at yahoo dot de
@ 2021-06-01  7:44 ` clyon at gcc dot gnu.org
  6 siblings, 0 replies; 11+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-06-01  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Assignee|unassigned at gcc dot gnu.org      |clyon at gcc dot gnu.org

--- Comment #13 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Yes, this will be part of gcc-12.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
  2010-01-02 10:09 [Bug c/42579] New: " rmh dot gcc at aybabtu dot com
                   ` (2 preceding siblings ...)
  2010-01-02 11:39 ` rmh dot gcc at aybabtu dot com
@ 2010-04-30  9:55 ` cfriedt at visible-assets dot com
  3 siblings, 0 replies; 11+ messages in thread
From: cfriedt at visible-assets dot com @ 2010-04-30  9:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from cfriedt at visible-assets dot com  2010-04-30 09:54 -------
(In reply to comment #0)
> Please consider this patch.  It adds support for obtaining file basename via
> __FILE_BASENAME__.

Please do! 

What would also be really nice would be to have similar functionality for C++,
with __CLASS__ and __METHOD__ macros.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
  2010-01-02 10:09 [Bug c/42579] New: " rmh dot gcc at aybabtu dot com
  2010-01-02 10:12 ` [Bug c/42579] " rmh dot gcc at aybabtu dot com
  2010-01-02 11:06 ` rguenth at gcc dot gnu dot org
@ 2010-01-02 11:39 ` rmh dot gcc at aybabtu dot com
  2010-04-30  9:55 ` cfriedt at visible-assets dot com
  3 siblings, 0 replies; 11+ messages in thread
From: rmh dot gcc at aybabtu dot com @ 2010-01-02 11:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rmh dot gcc at aybabtu dot com  2010-01-02 11:39 -------
(In reply to comment #2)
> __BASE_FILE__ could be enough for what you want.

Hi,

I tried already, but __BASE_FILE__ seems to be something unrelated.  It's
like __FILE__ but when used in an #include'd source it picks the includer
rather than the included file.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
  2010-01-02 10:09 [Bug c/42579] New: " rmh dot gcc at aybabtu dot com
  2010-01-02 10:12 ` [Bug c/42579] " rmh dot gcc at aybabtu dot com
@ 2010-01-02 11:06 ` rguenth at gcc dot gnu dot org
  2010-01-02 11:39 ` rmh dot gcc at aybabtu dot com
  2010-04-30  9:55 ` cfriedt at visible-assets dot com
  3 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-01-02 11:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-01-02 11:06 -------
__BASE_FILE__ could be enough for what you want.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug c/42579] [PATCH] support for obtaining file basename
  2010-01-02 10:09 [Bug c/42579] New: " rmh dot gcc at aybabtu dot com
@ 2010-01-02 10:12 ` rmh dot gcc at aybabtu dot com
  2010-01-02 11:06 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: rmh dot gcc at aybabtu dot com @ 2010-01-02 10:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rmh dot gcc at aybabtu dot com  2010-01-02 10:12 -------
Created an attachment (id=19445)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19445&action=view)
__FILE_BASENAME__

Attaching the patch.  Also sent to gcc-patches.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-06-01  7:44 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-42579-4@http.gcc.gnu.org/bugzilla/>
2012-08-31  8:00 ` [Bug c/42579] [PATCH] support for obtaining file basename asierllano at gmail dot com
2012-08-31  8:04 ` asierllano at gmail dot com
2021-05-20  8:13 ` cvs-commit at gcc dot gnu.org
2021-05-20  8:14 ` clyon at gcc dot gnu.org
2021-05-31 16:17 ` rdiezmail-gcc at yahoo dot de
2021-05-31 16:20 ` rdiezmail-gcc at yahoo dot de
2021-06-01  7:44 ` clyon at gcc dot gnu.org
2010-01-02 10:09 [Bug c/42579] New: " rmh dot gcc at aybabtu dot com
2010-01-02 10:12 ` [Bug c/42579] " rmh dot gcc at aybabtu dot com
2010-01-02 11:06 ` rguenth at gcc dot gnu dot org
2010-01-02 11:39 ` rmh dot gcc at aybabtu dot com
2010-04-30  9:55 ` cfriedt at visible-assets dot com

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).