00001 /* Various diagnostic subroutines for the GNU C language. 00002 Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. 00003 Contributed by Gabriel Dos Reis <gdr@codesourcery.com> 00004 00005 This file is part of GCC. 00006 00007 GCC is free software; you can redistribute it and/or modify it under 00008 the terms of the GNU General Public License as published by the Free 00009 Software Foundation; either version 2, or (at your option) any later 00010 version. 00011 00012 GCC is distributed in the hope that it will be useful, but WITHOUT ANY 00013 WARRANTY; without even the implied warranty of MERCHANTABILITY or 00014 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00015 for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with GCC; see the file COPYING. If not, write to the Free 00019 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 00020 02111-1307, USA. */ 00021 00022 #include "config.h" 00023 #include "system.h" 00024 #include "coretypes.h" 00025 #include "tm.h" 00026 #include "tree.h" 00027 #include "c-tree.h" 00028 #include "tm_p.h" 00029 #include "flags.h" 00030 #include "diagnostic.h" 00031 00032 /* Issue an ISO C99 pedantic warning MSGID. */ 00033 00034 void 00035 pedwarn_c99 (const char *gmsgid, ...) 00036 { 00037 diagnostic_info diagnostic; 00038 va_list ap; 00039 00040 va_start (ap, gmsgid); 00041 diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, 00042 flag_isoc99 ? pedantic_error_kind () : DK_WARNING); 00043 report_diagnostic (&diagnostic); 00044 va_end (ap); 00045 } 00046 00047 /* Issue an ISO C90 pedantic warning MSGID. This function is supposed to 00048 be used for matters that are allowed in ISO C99 but not supported in 00049 ISO C90, thus we explicitly don't pedwarn when C99 is specified. 00050 (There is no flag_c90.) */ 00051 00052 void 00053 pedwarn_c90 (const char *gmsgid, ...) 00054 { 00055 diagnostic_info diagnostic; 00056 va_list ap; 00057 00058 va_start (ap, gmsgid); 00059 diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location, 00060 flag_isoc99 ? DK_WARNING : pedantic_error_kind ()); 00061 report_diagnostic (&diagnostic); 00062 va_end (ap); 00063 }
1.5.6