Deleted Added
full compact
1/* Process declarations and variables for C compiler.
2 Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
3 2001, 2002 Free Software Foundation, Inc.
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free

--- 5 unchanged lines hidden (view full) ---

14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
21
22/* $FreeBSD: head/contrib/gcc/c-decl.c 96549 2002-05-14 00:30:25Z obrien $ */
22/* $FreeBSD: head/contrib/gcc/c-decl.c 96557 2002-05-14 01:44:02Z obrien $ */
23
24/* Process declarations and symbol lookup for C front end.
25 Also constructs types; the standard scalar types at initialization,
26 and structure, union, array and enum types when they are declared. */
27
28/* ??? not all decl nodes are given the most useful possible
29 line numbers. For example, the CONST_DECLs for enum values. */
30

--- 343 unchanged lines hidden (view full) ---

374
375int warn_traditional;
376
377/* Nonzero means warn about sizeof(function) or addition/subtraction
378 of function pointers. */
379
380int warn_pointer_arith;
381
382
383/* Nonzero means do not warn that K&R style main() is not a function prototype. */
384
385int flag_bsd_no_warn_kr_main;
386
387/* Nonzero means warn for non-prototype function decls
388 or non-prototyped defs without previous prototype. */
389
390int warn_strict_prototypes;
391
392/* Nonzero means warn for any global function def
393 without separate previous prototype decl. */
394

--- 136 unchanged lines hidden (view full) ---

531 iso_1994:
532 flag_traditional = 0;
533 flag_writable_strings = 0;
534 flag_no_asm = 1;
535 flag_no_nonansi_builtin = 1;
536 flag_noniso_default_format_attributes = 0;
537 flag_isoc99 = 0;
538 flag_bsd_format = 0;
539 flag_bsd_no_warn_kr_main = 0;
540 }
541 else if (!strcmp (argstart, "iso9899:199409"))
542 {
543 flag_isoc94 = 1;
544 goto iso_1994;
545 }
546 else if (!strcmp (argstart, "iso9899:199x")
547 || !strcmp (argstart, "iso9899:1999")
548 || !strcmp (argstart, "c9x")
549 || !strcmp (argstart, "c99"))
550 {
551 flag_traditional = 0;
552 flag_writable_strings = 0;
553 flag_no_asm = 1;
554 flag_no_nonansi_builtin = 1;
555 flag_noniso_default_format_attributes = 0;
556 flag_isoc99 = 1;
557 flag_isoc94 = 1;
558 flag_bsd_format = 0;
559 flag_bsd_no_warn_kr_main = 0;
560 }
561 else if (!strcmp (argstart, "gnu89"))
562 {
563 flag_traditional = 0;
564 flag_writable_strings = 0;
565 flag_no_asm = 0;
566 flag_no_nonansi_builtin = 0;
567 flag_noniso_default_format_attributes = 1;
568 flag_isoc99 = 0;
569 flag_isoc94 = 0;
570 flag_bsd_format = 0;
571 flag_bsd_no_warn_kr_main = 0;
572 }
573 else if (!strcmp (argstart, "gnu9x") || !strcmp (argstart, "gnu99"))
574 {
575 flag_traditional = 0;
576 flag_writable_strings = 0;
577 flag_no_asm = 0;
578 flag_no_nonansi_builtin = 0;
579 flag_noniso_default_format_attributes = 1;
580 flag_isoc99 = 1;
581 flag_isoc94 = 1;
582 flag_bsd_format = 0;
583 flag_bsd_no_warn_kr_main = 0;
584 }
585 else if (!strcmp (argstart, "bsd"))
586 {
587 flag_traditional = 0;
588 flag_writable_strings = 0;
589 flag_no_asm = 0;
590 flag_no_nonansi_builtin = 0;
591 flag_noniso_default_format_attributes = 1;
592 flag_isoc99 = 0;
593 flag_isoc94 = 0;
594 flag_isoc94 = 0;
595 flag_bsd_format = 1;
596 flag_bsd_no_warn_kr_main = 1;
597 }
598 else
599 error ("unknown C standard `%s'", argstart);
600 }
601 else if (!strcmp (p, "-fdollars-in-identifiers"))
602 dollars_in_ident = 1;
603 else if (!strcmp (p, "-fno-dollars-in-identifiers"))
604 dollars_in_ident = 0;

--- 5713 unchanged lines hidden (view full) ---

6318 old_decl = IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1));
6319
6320 /* Optionally warn of old-fashioned def with no previous prototype. */
6321 if (warn_strict_prototypes
6322 && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0
6323 && !(old_decl != 0
6324 && (TYPE_ARG_TYPES (TREE_TYPE (old_decl)) != 0
6325 || (DECL_BUILT_IN (old_decl)
6316 && ! C_DECL_ANTICIPATED (old_decl)))))
6326 && ! C_DECL_ANTICIPATED (old_decl))))
6327 && !(flag_bsd_no_warn_kr_main && 0 ==
6328 strcmp ("main", IDENTIFIER_POINTER (DECL_NAME (decl1)))))
6329 warning ("function declaration isn't a prototype");
6330 /* Optionally warn of any global def with no previous prototype. */
6331 else if (warn_missing_prototypes
6332 && TREE_PUBLIC (decl1)
6333 && !(old_decl != 0
6334 && (TYPE_ARG_TYPES (TREE_TYPE (old_decl)) != 0
6335 || (DECL_BUILT_IN (old_decl)
6336 && ! C_DECL_ANTICIPATED (old_decl))))

--- 1200 unchanged lines hidden ---