public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
@ 2000-04-01 18:40 Bradley M. Kuhn - Assistant to RMS
  2000-04-01 19:44 ` Zack Weinberg
  0 siblings, 1 reply; 4+ messages in thread
From: Bradley M. Kuhn - Assistant to RMS @ 2000-04-01 18:40 UTC (permalink / raw)
  To: gcc

This message was originally sent directly to RMS.  He asked me to forward
such messages along to <gcc@gcc.gnu.org>.

------- Start of forwarded message -------
Date: Sat, 25 Mar 2000 10:09:21 -0500 (EST)
From: "Eric R. Buddington" <ebuddington@mail.wesleyan.edu>
To: rms@gnu.org
Subject: cccp.c::print_help() not called.
Content-Type: TEXT/PLAIN; charset=US-ASCII
Content-Length: 742

Hi.

A while ago I was failing to fix a problem of autoconf wherein ./configure
did macro substitution with cpp, which had undesired, built-in defines.
I just now discovered the 'cpp -u' switch, which does what I want, but
doesn't appear in 'cpp --help'.

The cpp in the *build* directory gives the expected help message (from
cccp.c), but the xcpp that gets installed seems to be a different beast
entirely (basically a teraked gcc, according to the Makefile). I assume
that cccp.c is just for bootstrapping?

I propose that cccp.c::print_help() and cpp.c::display_help get moved into
cppspec.c and gccspec.c, respectively, in order to give more relevant
help for whatever program is invoked. Do you agree?

Eric Buddington
North Adams, MA
------- End of forwarded message -------

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

* Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
  2000-04-01 18:40 [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.] Bradley M. Kuhn - Assistant to RMS
@ 2000-04-01 19:44 ` Zack Weinberg
  2000-04-01 20:45   ` Zack Weinberg
       [not found]   ` <Pine.GSO.4.05.10004020148230.3603-100000@mail.wesleyan.edu>
  0 siblings, 2 replies; 4+ messages in thread
From: Zack Weinberg @ 2000-04-01 19:44 UTC (permalink / raw)
  To: Eric R. Buddington; +Cc: gcc, Bradley M. Kuhn - Assistant to RMS

> A while ago I was failing to fix a problem of autoconf wherein ./configure
> did macro substitution with cpp, which had undesired, built-in defines.
> I just now discovered the 'cpp -u' switch, which does what I want, but
> doesn't appear in 'cpp --help'.
> 
> The cpp in the *build* directory gives the expected help message (from
> cccp.c), but the xcpp that gets installed seems to be a different beast
> entirely (basically a teraked gcc, according to the Makefile). I assume
> that cccp.c is just for bootstrapping?

It's complicated.  cccp.c is the real preprocessor (in 2.95).  It
can't be used all by itself, it needs some help from the gcc driver.
xcpp is the gcc driver customized appropriately to work as /bin/cpp.

> I propose that cccp.c::print_help() and cpp.c::display_help get moved into
> cppspec.c and gccspec.c, respectively, in order to give more relevant
> help for whatever program is invoked. Do you agree?

You're right that 'cpp --help' is not at all helpful.  You might try
'cpp -v --help', which will get you three! copies of the help text you
wanted... but that doesn't mention the option you need either.
Bleah.  Patches for both issues coming right up.

There is no -u option; you must mean -undef.  Except that that doesn't
do what it's documented to do...

$ /work/inst/bin/cpp -undef -dM /dev/null
#define __i386__ 1
#define __tune_pentiumpro__ 1
#define i386 1
#define __i386 1

Note that in addition to the list you see there, there's about a dozen
more internal defines which it won't tell you about in -dM and which
can't be turned off at all:

__TIME__
__DATE__
__VERSION__
__STDC__
__SIZE_TYPE__
__PTRDIFF_TYPE__
__WCHAR_TYPE__
__FILE__
__BASE_FILE__
__LINE__
__INCLUDE_LEVEL__
__USER_LABEL_PREFIX__
__REGISTER_PREFIX__
__HAVE_BUILTIN_SETJMP__

I will be delighted to make cpp do the Right Thing as soon as we all
agree on what that is.  Should cpp -undef define *anything*?
Including the builtins?

You might have noticed the '-A-' option; it doesn't work at all.
That too will be fixed shortly.

zw

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

* Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
  2000-04-01 19:44 ` Zack Weinberg
@ 2000-04-01 20:45   ` Zack Weinberg
       [not found]   ` <Pine.GSO.4.05.10004020148230.3603-100000@mail.wesleyan.edu>
  1 sibling, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2000-04-01 20:45 UTC (permalink / raw)
  To: Eric R. Buddington; +Cc: gcc, gcc-patches

Right - here is the first patch for your problem.  cpp --help now
gives the right helptext, and -A- now works.  -undef still doesn't
undefine everything. I think all the cpp switches are now documented.
Please let me know if any are missing.

This won't help with 2.95, but it could probably be backported with
little trouble.  I need approval to check in changes to the specs, so
nothing has been committed.  

zw

	* cppinit.c: Update doc of -W(no-)traditional.  Document
	-undef and -A-.
	* cppspec.c: If we see -fhelp, remove it and insert an -h at
	the beginning of the command line.  Trim trailing whitespace.

	* gcc.c (C specs): Pass -h to cpp.  Move %{A*} after all the
	predefines.
	* ch/lang-specs.h, cp/lang-specs.h, f/lang-specs.h,
	objc/lang-specs.h: Likewise.

===================================================================
Index: cppinit.c
--- cppinit.c	2000/04/01 22:55:24	1.70
+++ cppinit.c	2000/04/02 04:40:59
@@ -1762,9 +1761,9 @@ Switches:\n\
   -Wno-trigraphs            Do not warn about trigraphs\n\
   -Wcomment{s}              Warn if one comment starts inside another\n\
   -Wno-comment{s}           Do not warn about comments\n\
-  -Wtraditional             Warn if a macro argument is/would be turned into\n\
-                             a string if -traditional is specified\n\
-  -Wno-traditional          Do not warn about stringification\n\
+  -Wtraditional             Warn about constructs that behave differently\n\
+                            in traditional C\n\
+  -Wno-traditional          Do not warn about traditional C\n\
   -Wundef                   Warn if an undefined macro is used by #if\n\
   -Wno-undef                Do not warn about testing undefined macros\n\
   -Wimport                  Warn about the use of the #import directive\n\
@@ -1780,9 +1779,11 @@ Switches:\n\
   -g3                       Include #define and #undef directives in the output\n\
   -D<macro>                 Define a <macro> with string '1' as its value\n\
   -D<macro>=<val>           Define a <macro> with <val> as its value\n\
+  -U<macro>                 Undefine <macro> \n\
+  -undef                    Undefine all predefined macros\n\
   -A<question> (<answer>)   Assert the <answer> to <question>\n\
   -A-<question> (<answer>)  Disable the <answer> to <question>\n\
-  -U<macro>                 Undefine <macro> \n\
+  -A-                       Disable all predefined assertions and macros\n\
   -v                        Display the version number\n\
   -H                        Print the name of header files as they are used\n\
   -C                        Do not discard comments\n\
===================================================================
Index: cppspec.c
--- cppspec.c	1999/09/13 04:40:51	1.8
+++ cppspec.c	2000/04/02 04:40:59
@@ -77,7 +77,7 @@ lang_specific_driver (in_argc, in_argv, 
 {
   int argc = *in_argc;
   char **argv = *in_argv;
-  
+
   /* Do we need to read stdin? */
   int read_stdin = 1;
 
@@ -87,9 +87,12 @@ lang_specific_driver (in_argc, in_argv, 
   /* Do we need to insert -no-gcc? */
   int need_no_gcc = 1;
 
+  /* Do we need to insert an "-h" at the beginning of the command line?  */
+  int need_h = 0;
+
   /* Have we seen an input file? */
   int seen_input = 0;
-  
+
   /* Positions to insert -xc, -xassembler-with-cpp, and -o, if necessary.
      0 means unnecessary. */
   int lang_c_here = 0;
@@ -98,7 +101,7 @@ lang_specific_driver (in_argc, in_argv, 
 
   /* Do we need to fix up an input file with an unrecognized suffix? */
   int need_fixups = 1;
-  
+
   int i, j, quote = 0;
   char **real_new_argv;
   const char **new_argv;
@@ -114,7 +117,7 @@ lang_specific_driver (in_argc, in_argv, 
 	  quote = 0;
 	  continue;
 	}
-      
+
       if (argv[i][0] == '-')
 	{
 	  if (argv[i][1] == '\0')
@@ -139,8 +142,10 @@ lang_specific_driver (in_argc, in_argv, 
 	    }
 	  else if (argv[i][1] == 'x')
 	    need_fixups = 0;
-	  else if (argv[i][1] == 'g' && !strcmp(&argv[i][2], "cc"))
+	  else if (argv[i][1] == 'g' && !strcmp (&argv[i][2], "cc"))
 	    need_no_gcc = 0;
+	  else if (argv[i][1] == 'f' && !strcmp (&argv[i][2], "help"))
+	    need_h = 1;
 	  else if (WORD_SWITCH_TAKES_ARG (&argv[i][1]))
 	    quote = 1;
 	}
@@ -189,7 +194,7 @@ lang_specific_driver (in_argc, in_argv, 
 
   /* If we don't need to edit the command line, we can bail early.  */
 
-  new_argc = argc + need_E + need_no_gcc + read_stdin
+  new_argc = argc + need_E + need_no_gcc + read_stdin + need_h
     + !!o_here + !!lang_c_here + !!lang_S_here;
 
   if (new_argc == argc)
@@ -205,10 +210,13 @@ lang_specific_driver (in_argc, in_argv, 
   if (need_E)
     new_argv[j++] = "-E";
 
+  if (need_h)
+    new_argv[j++] = "-h";
+
   if (need_no_gcc)
     new_argv[j++] = "-no-gcc";
 
-  for (i = 1; i < argc; i++, j++)
+  for (i = 1; i < argc; i++)
     {
       if (i == lang_c_here)
 	new_argv[j++] = "-xc";
@@ -217,7 +225,13 @@ lang_specific_driver (in_argc, in_argv, 
       else if (i == o_here)
 	new_argv[j++] = "-o";
 
-      new_argv[j] = argv[i];
+      /* -fhelp has to be _removed_ from the command line to
+	 prevent gcc.c from issuing its own help.  */
+      if (!(argv[i][0] == '-' && argv[i][1] == 'f'
+	    && !strcmp (&argv[i][2], "help")))
+	new_argv[j++] = argv[i];
+      else
+	new_argc--;
     }
 
   if (read_stdin)
@@ -226,7 +240,7 @@ lang_specific_driver (in_argc, in_argv, 
   new_argv[j] = NULL;
   *in_argc = new_argc;
   *in_argv = real_new_argv;
-} 
+}
 
 /* Called before linking.  Returns 0 on success and -1 on failure. */
 int lang_specific_pre_link ()
===================================================================
Index: gcc.c
--- gcc.c	2000/03/28 18:06:15	1.136
+++ gcc.c	2000/04/02 04:41:01
@@ -620,7 +620,7 @@ static struct compiler default_compilers
    {
 #if USE_CPPLIB
      "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
-	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+	%{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -631,10 +631,10 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
       %{!E:%{!M:%{!MM:cc1 %i %1 \
-                  %{std*} %{nostdinc*} %{A*} %{I*} %I\
+                  %{std*} %{nostdinc*} %{I*} %I\
                   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
                   %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
                   %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -643,7 +643,7 @@ static struct compiler default_compilers
 		  %{ffast-math:-D__FAST_MATH__}\
 		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
 		  %{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
-                  %{H} %C %{D*} %{U*} %{i*} %Z\
+                  %{H} %C %{A*} %{D*} %{U*} %{i*} %Z\
                   %{ftraditional:-traditional}\
                   %{traditional-cpp:-traditional}\
 		  %{traditional} %{v:-version} %{pg:-p} %{p} %{f*}\
@@ -657,7 +657,7 @@ static struct compiler default_compilers
                      %{!pipe:%g.s} %A\n }}}}"
 #else /* ! USE_CPPLIB */
     "cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
-	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+	%{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -668,7 +668,7 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
    "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \
 		   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
@@ -685,7 +685,7 @@ static struct compiler default_compilers
   }},
   {"-",
    {"%{E:cpp -lang-c %{ansi:-std=c89} %{std*} %{nostdinc*}\
-	%{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+	%{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -696,13 +696,13 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %W{o*}}\
     %{!E:%e-E required when input is from standard input}"}},
   {".h", {"@c-header"}},
   {"@c-header",
    {"%{!E:%eCompilation of header file requested} \
-    cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+    cpp %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -714,7 +714,7 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %W{o*}"}},
   {".i", {"@cpp-output"}},
   {"@cpp-output",
@@ -734,7 +734,7 @@ static struct compiler default_compilers
 			    %i %A\n }}}}"}},
   {".S", {"@assembler-with-cpp"}},
   {"@assembler-with-cpp",
-   {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+   {"cpp -lang-asm %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} %{trigraphs}\
         -$ %{!undef:%p %P} -D__ASSEMBLER__ \
@@ -744,7 +744,7 @@ static struct compiler default_compilers
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:%{!S:as %a %Y\
                     %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
===================================================================
Index: ch/lang-specs.h
--- ch/lang-specs.h	2000/02/16 07:54:51	1.10
+++ ch/lang-specs.h	2000/04/02 04:41:01
@@ -24,12 +24,12 @@ Boston, MA 02111-1307, USA.  */
   {".ch",  {"@chill"}},
   {".chi", {"@chill"}},
   {"@chill",
-     {"cpp -lang-chill %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+     {"cpp -lang-chill %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU CHILL does not support -C without using -E}}\
         %{!no-gcc:-D__GNUCHILL__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional} %{!undef:%{!ansi:%p} %P} %{trigraphs}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{!E:%g.i}%{E:%W{o*}} \n",
    "%{!E:cc1chill %g.i %1 \
 		   %{!Q:-quiet} -dumpbase %b.ch %{d*} %{m*} %{a}\
===================================================================
Index: cp/lang-specs.h
--- cp/lang-specs.h	2000/03/06 13:37:50	1.23
+++ cp/lang-specs.h	2000/04/02 04:41:01
@@ -31,7 +31,7 @@ Boston, MA 02111-1307, USA.  */
   {"@c++",
 #if USE_CPPLIB
    {
-     "%{E|M|MM:cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+     "%{E|M|MM:cpp -lang-c++ %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
 	%{!no-gcc:-D__GNUC__=%v1 -D__GNUG__=%v1 -D__GNUC_MINOR__=%v2\
@@ -41,10 +41,10 @@ Boston, MA 02111-1307, USA.  */
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
 	%{ffast-math:-D__FAST_MATH__}\
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}\
       %{!E:%{!M:%{!MM:cc1plus %i %1 %2\
-                            -lang-c++ %{nostdinc*} %{C} %{A*} %{I*} %{P} %{$} %I\
+                            -lang-c++ %{nostdinc*} %{C} %{I*} %{P} %{$} %I\
                             %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
                             %{!no-gcc:-D__GNUC__=%v1 -D__GNUG__=%v1\
                             -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -58,7 +58,7 @@ Boston, MA 02111-1307, USA.  */
                             %{trigraphs}\
 			    %{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
 			    %{g*} %{O*} %{W*} %{w} %{pedantic*} %{ansi}\
-                            %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+                            %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
 			    %{v:-version} %{pg:-p} %{p}\
 			    %{f*} %{+e*} %{aux-info*} %{Qn:-fno-ident}\
 			    %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
@@ -67,7 +67,7 @@ Boston, MA 02111-1307, USA.  */
 		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
                       %{!pipe:%g.s} %A\n }}}}}"}},
 #else /* ! USE_CPPLIB */
-   {"cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+   {"cpp -lang-c++ %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C++ does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
 	%{!no-gcc:-D__GNUC__=%v1 -D__GNUG__=%v1 -D__GNUC_MINOR__=%v2\
@@ -78,7 +78,7 @@ Boston, MA 02111-1307, USA.  */
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} %{trigraphs}\
 	%{ffast-math:-D__FAST_MATH__}\
 	%{fshort-wchar:-D__WCHAR_TYPE__=short\\ unsigned\\ int}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.ii}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.ii} %1 %2\
 			    %{!Q:-quiet} -dumpbase %b.cc %{d*} %{m*} %{a}\
===================================================================
Index: f/lang-specs.h
--- f/lang-specs.h	2000/02/26 20:02:01	1.19
+++ f/lang-specs.h	2000/04/02 04:41:01
@@ -35,7 +35,7 @@ the Free Software Foundation, 59 Temple 
 	Sun f77, at least) so you test `__unix' rather than `unix'.
 	-D_LANGUAGE_FORTRAN is used by some compilers like SGI and
 	might as well be in there. */
-   {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+   {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
 	%{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3}\
@@ -43,7 +43,7 @@ the Free Software Foundation, 59 Temple 
 	%{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \
 	%c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional\
 	%{ffast-math:-D__FAST_MATH__}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
 	%i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:f771 %{!pipe:%g.i} %1 %(f771) \
 		   %{!Q:-quiet} -dumpbase %b.F %{d*} %{m*} %{a*}\
@@ -85,7 +85,7 @@ the Free Software Foundation, 59 Temple 
 		      %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
 		      %{!pipe:%g.s} %A\n }}}}"}},
   {"@f77-version",
-   {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I \
+   {"cpp -lang-fortran %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I \
       %{C:%{!E:%eGNU C does not support -C without using -E}} \
       %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG} \
       %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2 -D__GNUC_PATCHLEVEL__=%v3} \
@@ -93,7 +93,7 @@ the Free Software Foundation, 59 Temple 
       %{!undef:%P} -D_LANGUAGE_FORTRAN %{trigraphs} \
       %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}} -traditional \
       %{ffast-math:-D__FAST_MATH__}\
-      %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z \
+      %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z \
       /dev/null /dev/null \n\
      f771 -fnull-version %1 %(f771) \
       %{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a*} \
===================================================================
Index: objc/lang-specs.h
--- objc/lang-specs.h	2000/02/17 06:07:20	1.10
+++ objc/lang-specs.h	2000/04/02 04:41:01
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA.  */
   {".m", {"@objective-c"}},
   {"@objective-c",
 #if USE_CPPLIB
-   {"%{E|M|MM:cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+   {"%{E|M|MM:cpp -lang-objc %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         -D__OBJC__ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
@@ -35,10 +35,10 @@ Boston, MA 02111-1307, USA.  */
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}}\n}",
     "%{!M:%{!MM:%{!E:cc1obj %i %1 \
-		   %{nostdinc*} %{A*} %{I*} %{P} %I\
+		   %{nostdinc*} %{I*} %{P} %I\
                    %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
 		   -D__OBJC__ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
 		   -D__GNUC_PATCHLEVEL__=%v3}\
@@ -56,7 +56,7 @@ Boston, MA 02111-1307, USA.  */
 	%{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}\
         %{!pipe:%g.s} %A\n }}}}"}
 #else /* ! USE_CPPLIB */
-   {"cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %{$} %I\
+   {"cpp -lang-objc %{nostdinc*} %{C} %{v} %{h} %{I*} %{P} %{$} %I\
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         -D__OBJC__ %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2\
@@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA.  */
         %{traditional} %{ftraditional:-traditional}\
         %{traditional-cpp:-traditional}\
 	%{fleading-underscore} %{fno-leading-underscore}\
-	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*} %Z\
+	%{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{A*} %{D*} %{U*} %{i*} %Z\
         %i %{!M:%{!MM:%{!E:%{!pipe:%g.mi}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n",
     "%{!M:%{!MM:%{!E:cc1obj %{!pipe:%g.mi} %1 \
 		   %{!Q:-quiet} -dumpbase %b.m %{d*} %{m*} %{a*}\

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

* Re: [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.]
       [not found]   ` <Pine.GSO.4.05.10004020148230.3603-100000@mail.wesleyan.edu>
@ 2000-04-01 23:59     ` Zack Weinberg
  0 siblings, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 2000-04-01 23:59 UTC (permalink / raw)
  To: Eric R. Buddington; +Cc: gcc

On Sun, Apr 02, 2000 at 01:53:01AM -0500, Eric R. Buddington wrote:
> On Sat, 1 Apr 2000, Zack Weinberg wrote:
> 
> > There is no -u option; you must mean -undef.  Except that that doesn't
> > do what it's documented to do...
> > 
> > $ /work/inst/bin/cpp -undef -dM /dev/null
> > #define __i386__ 1
> > #define __tune_pentiumpro__ 1
> > #define i386 1
> > #define __i386 1
> 
> Probably not important at this point, but my cpp recognizes a -u option,
> which does something useful:
...
> bash-2.02$ cpp -u -dM /dev/null
> # 1 "/dev/null"

Yeah, but it doesn't do what you think it does.  Watch:

$ cpp --version
2.95.2
$ cpp -dM /dev/null -u
cpp: argument to `-u' is missing

You thought it was undefining symbols because the -dM got eaten, so it
didn't print anything - but you would never have seen `# 1 "/dev/null"'
in -dM mode.

It turns out that -u is passed to the linker.  From man ld:

       -u sym Forces sym to be entered in the output file as an
              undefined symbol.  This may, for example, trigger
              linking of additional modules from standard libraries.
              -u may be repeated with different option arguments to
              enter additional undefined symbols.

And no, the 'cpp' wrapper won't ever run the linker, but it recognizes
the option anyway.

zw

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

end of thread, other threads:[~2000-04-01 23:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-01 18:40 [ebuddington@mail.wesleyan.edu: cccp.c::print_help() not called.] Bradley M. Kuhn - Assistant to RMS
2000-04-01 19:44 ` Zack Weinberg
2000-04-01 20:45   ` Zack Weinberg
     [not found]   ` <Pine.GSO.4.05.10004020148230.3603-100000@mail.wesleyan.edu>
2000-04-01 23:59     ` Zack Weinberg

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