This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/33919] __BASE_FILE__ does not expand correctly when included from the command line
- From: "gary at intrepid dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 22 Dec 2011 04:03:55 +0000
- Subject: [Bug preprocessor/33919] __BASE_FILE__ does not expand correctly when included from the command line
- Auto-submitted: auto-generated
- References: <bug-33919-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33919
--- Comment #5 from Gary Funck <gary at intrepid dot com> 2011-12-22 04:03:55 UTC ---
(In reply to comment #4)
> I'm having this problem too, and it's still happening with GCC 4.5. The ml
> message suggests that this may be hard to fix, but it looks surprisingly easy:
> instead of tracing back via INCLUDED_FROM, simply look at pfile->main_file
> which already contains the right file name. It just needs an accessor function
> because _cpp_file's definition is kept internal.
Per Harald's suggestion, I submitted a patch for review.
http://gcc.gnu.org/ml/gcc-patches/2011-12/msg01594.html