This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Squelch some more cygwin specific warnings


On Sat, Mar 17, 2001 at 11:00:25PM -0000, Billinghurst, David (CRTS) wrote:
>This patch fixes a number of cygwin specific warnings in toplev.c, varasm.c
>and winnt.c.  Just a couple of headers, some missing declarations and a few
>char * -> const char *. 
>
>Bootstrapped 3.0 branch on cygwin.  Similar patch bootstrapped on head
>yesterday.  Please commit if OK
>
>
>2001-03-18  David Billinghurst <David.Billinghurst@riotinto.com>
>
>	    * config/i386/cygwin.h: Include <stdio.h>

I've always wondered why stdio.h wasn't included automatically.  I wonder
if it caused problems somewhere.

Everything else looks good.  I'll check this in with the comment that
Neil Booth suggested in another message.

cgf

>	    Declare and constify functions i386_pe_* 
>
>	    * config/i386/winnt.c: Include "tm_p.h" and "toplev.h"
>	    Constify i386_pe_* functions with char * arguments.
>
>--- cygwin.h.orig	Sat Mar 10 18:38:12 2001
>+++ cygwin.h	Sun Mar 18 00:08:22 2001
>@@ -28,6 +28,7 @@
> #define SDB_DEBUGGING_INFO 
> #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
> 
>+#include <stdio.h>
> #include "i386/gas.h"
> #include "dbxcoff.h"
> 
>@@ -544,10 +545,12 @@
> #endif
> #endif
> 
>-extern void i386_pe_record_external_function PARAMS ((char *));
>-/* extern void i386_pe_declare_function_type PARAMS ((FILE *, char *,
>int)); */
>-extern void i386_pe_record_exported_symbol PARAMS ((char *, int));
>-/* extern void i386_pe_asm_file_end PARAMS ((FILE *)); */
>+extern void i386_pe_record_external_function PARAMS ((const char *));
>+extern void i386_pe_declare_function_type PARAMS ((FILE *, const char *,
>int));
>+extern void i386_pe_record_exported_symbol PARAMS ((const char *, int));
>+extern void i386_pe_asm_file_end PARAMS ((FILE *));
>+extern int i386_pe_dllexport_name_p PARAMS ((const char *));
>+extern int i386_pe_dllimport_name_p PARAMS ((const char *));
> 
> /* For Win32 ABI compatibility */
> #undef DEFAULT_PCC_STRUCT_RETURN
>
>--- winnt.c.orig	Tue Jan 16 19:57:04 2001
>+++ winnt.c	Sun Mar 18 00:05:43 2001
>@@ -27,6 +27,8 @@
> #include "output.h"
> #include "tree.h"
> #include "flags.h"
>+#include "tm_p.h"
>+#include "toplev.h"
> 
> /* i386/PE specific attribute support.
> 
>@@ -226,7 +228,7 @@
> 
> int
> i386_pe_dllexport_name_p (symbol)
>-     char *symbol;
>+     const char *symbol;
> {
>   return symbol[0] == '@' && symbol[1] == 'e' && symbol[2] == '.';
> }
>@@ -235,7 +237,7 @@
> 
> int
> i386_pe_dllimport_name_p (symbol)
>-     char *symbol;
>+     const char *symbol;
> {
>   return symbol[0] == '@' && symbol[1] == 'i' && symbol[2] == '.';
> }
>@@ -247,7 +249,8 @@
> i386_pe_mark_dllexport (decl)
>      tree decl;
> {
>-  char *oldname, *newname;
>+  const char *oldname;
>+  char  *newname;
>   rtx rtlname;
>   tree idp;
> 
>@@ -283,7 +286,8 @@
> i386_pe_mark_dllimport (decl)
>      tree decl;
> {
>-  char *oldname, *newname;
>+  const char *oldname;
>+  char  *newname;
>   tree idp;
>   rtx rtlname, newrtl;
> 
>@@ -370,14 +374,14 @@
>    suffix consisting of an atsign (@) followed by the number of bytes of 
>    arguments */
> 
>-char *
>+const char *
> gen_stdcall_suffix (decl)
>   tree decl;
> {
>   int total = 0;
>   /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0)
>instead
>      of DECL_ASSEMBLER_NAME.  */
>-  char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
>+  const char *asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
>   char *newsym;
> 
>   if (TYPE_ARG_TYPES (TREE_TYPE (decl)))
>@@ -444,7 +448,7 @@
> 	   && GET_CODE (XEXP (XEXP (DECL_RTL (decl), 0), 0)) == SYMBOL_REF
> 	   && i386_pe_dllimport_name_p (XSTR (XEXP (XEXP (DECL_RTL (decl),
>0), 0), 0)))
>     {
>-      char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
>+      const char *oldname = XSTR (XEXP (XEXP (DECL_RTL (decl), 0), 0), 0);
>       tree idp = get_identifier (oldname + 9);
>       rtx newrtl = gen_rtx (SYMBOL_REF, Pmode, IDENTIFIER_POINTER (idp));
> 
>@@ -465,8 +469,8 @@
>      int reloc;
> {
>   int len;
>-  const char *name;
>-  char *string,*prefix;
>+  const char *name, *prefix;
>+  char *string;
> 
>   name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
>   /* Strip off any encoding in fnname.  */
>@@ -513,7 +517,7 @@
> void
> i386_pe_declare_function_type (file, name, public)
>      FILE *file;
>-     char *name;
>+     const char *name;
>      int public;
> {
>   fprintf (file, "\t.def\t");
>@@ -528,7 +532,7 @@
> struct extern_list
> {
>   struct extern_list *next;
>-  char *name;
>+  const char *name;
> };
> 
> static struct extern_list *extern_head;
>@@ -541,7 +545,7 @@
> 
> void
> i386_pe_record_external_function (name)
>-     char *name;
>+     const char *name;
> {
>   struct extern_list *p;
> 
>@@ -556,7 +560,7 @@
> struct export_list
> {
>   struct export_list *next;
>-  char *name;
>+  const char *name;
>   int is_data;		/* used to type tag exported symbols. */
> };
> 
>@@ -570,7 +574,7 @@
> 
> void
> i386_pe_record_exported_symbol (name, is_data)
>-     char *name;
>+     const char *name;
>      int is_data;
> {
>   struct export_list *p;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]