From 65a7af3fc16b95477ea416f9410d6ff627a03e1e Mon Sep 17 00:00:00 2001 From: zack Date: Mon, 31 Jul 2000 18:10:31 +0000 Subject: * c-decl.c (mesg_implicit_function_declaration): Init to -1. (implicit_decl_warning): New function. (implicitly_declare): Use it. * c-typeck.c (build_external_ref): Use implicit_decl_warning to complain about implicit decls of builtins. * c-lang.c (lang_init): Set mesg_implicit_function_declaration based on pedantic && flag_isoc99, if not already set. * c-tree.h: Declare mesg_implicit_function_declaration. Prototype implicit_decl_warning. * gcc.dg/c99-impl-decl-1.c: No longer XFAIL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@35385 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-lang.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gcc/c-lang.c') diff --git a/gcc/c-lang.c b/gcc/c-lang.c index 620ed78c676..a34f306b4ff 100644 --- a/gcc/c-lang.c +++ b/gcc/c-lang.c @@ -69,6 +69,15 @@ lang_init () if (flag_bounds_check < 0) flag_bounds_check = flag_bounded_pointers; + /* If still unspecified, make it match pedantic && -std=c99. */ + if (mesg_implicit_function_declaration < 0) + { + if (pedantic && flag_isoc99) + mesg_implicit_function_declaration = flag_pedantic_errors ? 2 : 1; + else + mesg_implicit_function_declaration = 0; + } + /* the beginning of the file is a new line; check for # */ /* With luck, we discover the real source file's name from that and put it in input_filename. */ -- cgit v1.2.3