This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Protoize does not build with gcc 4.x
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: James E Wilson <wilson at specifixinc dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 04 May 2005 18:58:16 +0100
- Subject: Re: Protoize does not build with gcc 4.x
- References: <20050427075446.GA2986@de.ibm.com> <87is24lk7w.fsf@firetop.home><427817CF.2090700@specifixinc.com>
James E Wilson <wilson@specifixinc.com> writes:
> Richard Sandiford wrote:
>> Wrt (a), I'm not sure what purpose GET_ENVIRONMENT serves.
>
> Once upon a time, the cygwin port used it to convert pathnames between
> windows style and posix style.
Ah, that explains it, thanks.
> Since protoize is of little interest nowadays, I agree that the simple
> solutions are best. I think you should add a comment explaining why
> these variables aren't static, though, to avoid later confusion.
>
> With that change, OK for mainline.
Thanks. For the record, here's the patch I committed.
Richard
* protoize.c (version_flag, quiet_flag, nochange_flag, nosave_flag)
(keep_flag, local_flag, global_flag, cplusplus_flag): Make extern.
Index: protoize.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/protoize.c,v
retrieving revision 1.95
diff -u -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.95 protoize.c
--- protoize.c 28 Apr 2005 05:38:34 -0000 1.95
+++ protoize.c 4 May 2005 17:53:59 -0000
@@ -361,6 +361,8 @@ static const char *pname;
static int errors = 0;
/* Option flags. */
+/* ??? The variables are not marked static because some of them have
+ the same names as gcc variables declared in options.h. */
/* ??? These comments should say what the flag mean as well as the options
that set them. */
@@ -368,20 +370,20 @@ static int errors = 0;
something other than gcc. */
static const char *compiler_file_name = "gcc";
-static int version_flag = 0; /* Print our version number. */
-static int quiet_flag = 0; /* Don't print messages normally. */
-static int nochange_flag = 0; /* Don't convert, just say what files
- we would have converted. */
-static int nosave_flag = 0; /* Don't save the old version. */
-static int keep_flag = 0; /* Don't delete the .X files. */
+int version_flag = 0; /* Print our version number. */
+int quiet_flag = 0; /* Don't print messages normally. */
+int nochange_flag = 0; /* Don't convert, just say what files
+ we would have converted. */
+int nosave_flag = 0; /* Don't save the old version. */
+int keep_flag = 0; /* Don't delete the .X files. */
static const char ** compile_params = 0; /* Option string for gcc. */
#ifdef UNPROTOIZE
static const char *indent_string = " "; /* Indentation for newly
inserted parm decls. */
#else /* !defined (UNPROTOIZE) */
-static int local_flag = 0; /* Insert new local decls (when?). */
-static int global_flag = 0; /* set by -g option */
-static int cplusplus_flag = 0; /* Rename converted files to *.C. */
+int local_flag = 0; /* Insert new local decls (when?). */
+int global_flag = 0; /* set by -g option */
+int cplusplus_flag = 0; /* Rename converted files to *.C. */
static const char *nondefault_syscalls_dir = 0; /* Dir to look for
SYSCALLS.c.X in. */
#endif /* !defined (UNPROTOIZE) */