OSDN Git Service

* toplev.h: Add comment about the first parameter for warning().
[pf3gnuchains/gcc-fork.git] / gcc / config / v850 / v850-c.c
index 431114e..cbb86cd 100644 (file)
@@ -2,22 +2,22 @@
    Copyright (C) 2000 Free Software Foundation, Inc.
    Contributed by Jeff Law (law@cygnus.com).
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+GCC is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2, or (at your option)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+along with GCC; see the file COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -34,15 +34,14 @@ Boston, MA 02111-1307, USA.  */
 #define streq(a,b) (strcmp (a, b) == 0)
 #endif
 \f
-static int  pop_data_area          PARAMS ((v850_data_area));
-static int  push_data_area         PARAMS ((v850_data_area));
-static void mark_current_function_as_interrupt PARAMS ((void));
+static int  pop_data_area          (v850_data_area);
+static int  push_data_area         (v850_data_area);
+static void mark_current_function_as_interrupt (void);
 \f
 /* Push a data area onto the stack.  */
 
 static int
-push_data_area (data_area)
-     v850_data_area data_area;
+push_data_area (v850_data_area data_area)
 {
   data_area_stack_element * elem;
 
@@ -62,13 +61,14 @@ push_data_area (data_area)
 /* Remove a data area from the stack.  */
 
 static int
-pop_data_area (data_area)
-     v850_data_area data_area;
+pop_data_area (v850_data_area data_area)
 {
   if (data_area_stack == NULL)
-    warning ("#pragma GHS endXXXX found without previous startXXX");
+    warning (OPT_Wpragmas, "#pragma GHS endXXXX found without "
+            "previous startXXX");
   else if (data_area != data_area_stack->data_area)
-    warning ("#pragma GHS endXXX does not match previous startXXX");
+    warning (OPT_Wpragmas, "#pragma GHS endXXX does not match "
+            "previous startXXX");
   else
     {
       data_area_stack_element * elem;
@@ -87,13 +87,13 @@ pop_data_area (data_area)
 /* Set the machine specific 'interrupt' attribute on the current function.  */
 
 static void
-mark_current_function_as_interrupt ()
+mark_current_function_as_interrupt (void)
 {
   tree name;
   
   if (current_function_decl ==  NULL_TREE)
     {
-      warning ("cannot set interrupt attribute: no current function");
+      warning (0, "cannot set interrupt attribute: no current function");
       return;
     }
 
@@ -101,7 +101,7 @@ mark_current_function_as_interrupt ()
 
   if (name == NULL_TREE || TREE_CODE (name) != IDENTIFIER_NODE)
     {
-      warning ("cannot set interrupt attribute: no such identifier");
+      warning (0, "cannot set interrupt attribute: no such identifier");
       return;
     }
   
@@ -113,8 +113,7 @@ mark_current_function_as_interrupt ()
 /* Support for GHS pragmata.  */
 
 void
-ghs_pragma_section (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_section (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   int repeat;
 
@@ -147,7 +146,7 @@ ghs_pragma_section (pfile)
       if (type == CPP_COMMA)
        repeat = 1;
       else if (type != CPP_EOF)
-       warning ("junk at end of #pragma ghs section");
+       warning (OPT_Wpragmas, "junk at end of #pragma ghs section");
       
       if      (streq (sect, "data"))    kind = GHS_SECTION_KIND_DATA;
       else if (streq (sect, "text"))    kind = GHS_SECTION_KIND_TEXT;
@@ -164,7 +163,7 @@ ghs_pragma_section (pfile)
       else if (streq (sect, "zbss"))    kind = GHS_SECTION_KIND_ZDATA;
       else
        {
-         warning ("unrecognized section name \"%s\"", sect);
+         warning (0, "unrecognized section name \"%s\"", sect);
          return;
        }
       
@@ -179,7 +178,7 @@ ghs_pragma_section (pfile)
   return;
 
  bad:
-  warning ("malformed #pragma ghs section");
+  warning (OPT_Wpragmas, "malformed #pragma ghs section");
   return;
 
  reset:
@@ -193,85 +192,78 @@ ghs_pragma_section (pfile)
 }
 
 void
-ghs_pragma_interrupt (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_interrupt (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs interrupt");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs interrupt");
   
   mark_current_function_as_interrupt ();
 }
 
 void
-ghs_pragma_starttda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_starttda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs starttda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs starttda");
   
   push_data_area (DATA_AREA_TDA);
 }
 
 void
-ghs_pragma_startsda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_startsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs startsda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs startsda");
   
   push_data_area (DATA_AREA_SDA);
 }
 
 void
-ghs_pragma_startzda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_startzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs startzda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs startzda");
   
   push_data_area (DATA_AREA_ZDA);
 }
 
 void
-ghs_pragma_endtda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_endtda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs endtda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs endtda");
   
   pop_data_area (DATA_AREA_TDA);
 }
 
 void
-ghs_pragma_endsda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_endsda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs endsda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs endsda");
   
   pop_data_area (DATA_AREA_SDA);
 }
 
 void
-ghs_pragma_endzda (pfile)
-     cpp_reader *pfile ATTRIBUTE_UNUSED;
+ghs_pragma_endzda (cpp_reader * pfile ATTRIBUTE_UNUSED)
 {
   tree x;
   
   if (c_lex (&x) != CPP_EOF)
-    warning ("junk at end of #pragma ghs endzda");
+    warning (OPT_Wpragmas, "junk at end of #pragma ghs endzda");
   
   pop_data_area (DATA_AREA_ZDA);
 }