public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] c++: Fall back to global cpp spec if CPLUSPLUS_CPP_SPEC is not defined
@ 2022-11-28 14:02 Joakim Nohlgård
  0 siblings, 0 replies; only message in thread
From: Joakim Nohlgård @ 2022-11-28 14:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joakim Nohlgård

When CPLUSPLUS_CPP_SPEC is set to a string literal it is not possible to
modify it through external spec files by renaming the original cpp spec
and replacing it because the compiler cpp_spec will still point to the
original, renamed cpp spec. Not defining CPLUSPLUS_CPP_SPEC makes gcc.cc
fall back to using the same cpp spec as the C compiler when substituting
%C in spec strings.

gcc/ChangeLog:

	* defaults.h (CPLUSPLUS_CPP_SPEC): Remove default definition.

Signed-off-by: Joakim Nohlgård <joakim@nohlgard.se>
---
 gcc/defaults.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/gcc/defaults.h b/gcc/defaults.h
index 376687d91b1..223460ef239 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -783,14 +783,6 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #endif
 #endif
 
-/* By default, the preprocessor should be invoked the same way in C++
-   as in C.  */
-#ifndef CPLUSPLUS_CPP_SPEC
-#ifdef CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC CPP_SPEC
-#endif
-#endif
-
 #ifndef ACCUMULATE_OUTGOING_ARGS
 #define ACCUMULATE_OUTGOING_ARGS 0
 #endif
-- 
2.38.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-28 14:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-28 14:02 [PATCH] c++: Fall back to global cpp spec if CPLUSPLUS_CPP_SPEC is not defined Joakim Nohlgård

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