Mercurial > hg > CbC > CbC_gcc
diff libcpp/macro.c @ 63:b7f97abdc517 gcc-4.6-20100522
update gcc from gcc-4.5.0 to gcc-4.6
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 24 May 2010 12:47:05 +0900 |
parents | 77e2b8dfacca |
children | f6334be47118 |
line wrap: on
line diff
--- a/libcpp/macro.c Fri Feb 12 23:41:23 2010 +0900 +++ b/libcpp/macro.c Mon May 24 12:47:05 2010 +0900 @@ -83,8 +83,8 @@ if (!macro->used && MAIN_FILE_P (linemap_lookup (pfile->line_table, macro->line))) - cpp_error_with_line (pfile, CPP_DL_WARNING, macro->line, 0, - "macro \"%s\" is not used", NODE_NAME (node)); + cpp_warning_with_line (pfile, CPP_W_UNUSED_MACROS, macro->line, 0, + "macro \"%s\" is not used", NODE_NAME (node)); } return 1; @@ -860,9 +860,9 @@ if (buff == NULL) { if (CPP_WTRADITIONAL (pfile) && ! node->value.macro->syshdr) - cpp_error (pfile, CPP_DL_WARNING, + cpp_warning (pfile, CPP_W_TRADITIONAL, "function-like macro \"%s\" must be used with arguments in traditional C", - NODE_NAME (node)); + NODE_NAME (node)); if (pragma_buff) _cpp_release_buff (pfile, pragma_buff); @@ -1585,13 +1585,14 @@ if (! CPP_OPTION (pfile, c99) && CPP_OPTION (pfile, pedantic) && CPP_OPTION (pfile, warn_variadic_macros)) - cpp_error (pfile, CPP_DL_PEDWARN, - "anonymous variadic macros were introduced in C99"); + cpp_pedwarning + (pfile, CPP_W_VARIADIC_MACROS, + "anonymous variadic macros were introduced in C99"); } else if (CPP_OPTION (pfile, pedantic) && CPP_OPTION (pfile, warn_variadic_macros)) - cpp_error (pfile, CPP_DL_PEDWARN, - "ISO C does not permit named variadic macros"); + cpp_pedwarning (pfile, CPP_W_VARIADIC_MACROS, + "ISO C does not permit named variadic macros"); /* We're at the end, and just expect a closing parenthesis. */ token = _cpp_lex_token (pfile); @@ -1894,10 +1895,14 @@ if (warn_of_redefinition (pfile, node, macro)) { + const int reason = (node->flags & NODE_BUILTIN) + ? CPP_W_BUILTIN_MACRO_REDEFINED : CPP_W_NONE; bool warned; - warned = cpp_error_with_line (pfile, CPP_DL_PEDWARN, - pfile->directive_line, 0, - "\"%s\" redefined", NODE_NAME (node)); + + warned = cpp_pedwarning_with_line (pfile, reason, + pfile->directive_line, 0, + "\"%s\" redefined", + NODE_NAME (node)); if (warned && node->type == NT_MACRO && !(node->flags & NODE_BUILTIN)) cpp_error_with_line (pfile, CPP_DL_NOTE,