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] New: [PATCH] support for obtaining file basename
@ 2010-01-02 10:09 rmh dot gcc at aybabtu dot com
2010-01-02 10:12 ` [Bug c/42579] " rmh dot gcc at aybabtu dot com
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: rmh dot gcc at aybabtu dot com @ 2010-01-02 10:09 UTC (permalink / raw)
To: gcc-bugs
Please consider this patch. It adds support for obtaining file basename via
__FILE_BASENAME__.
This would be used by GNU GRUB. I'll provide some explanation on why this is
very necessary for us:
- Bootloader code is very critical; a bug can render system unbootable.
Additionally, it needs to support a wide range of hardware and firmware.
Because of this, we put extensive debugging support into GRUB. Debug
statements currently rely on __FILE__.
- We want to support $srcdir != $objdir build setups, and continue supporting
them.
- Some parts of bootstrap code tend to be very size constrained. Every byte
counts, and each debug statement is taking unnecessary space because accessing
a file in $srcdir requires either an absolute path or at least a number of
'../' components (in Debian, that would be two of them).
Because of this, I would find it very useful if GCC provided __FILE_BASENAME__,
or at least an equivalent facility.
--
Summary: [PATCH] support for obtaining file basename
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rmh dot gcc at aybabtu dot com
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).