c-decl.c (96549) | c-decl.c (96557) |
---|---|
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 | 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 | 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 |
|
382/* Nonzero means warn for non-prototype function decls 383 or non-prototyped defs without previous prototype. */ 384 385int warn_strict_prototypes; 386 387/* Nonzero means warn for any global function def 388 without separate previous prototype decl. */ 389 --- 136 unchanged lines hidden (view full) --- 526 iso_1994: 527 flag_traditional = 0; 528 flag_writable_strings = 0; 529 flag_no_asm = 1; 530 flag_no_nonansi_builtin = 1; 531 flag_noniso_default_format_attributes = 0; 532 flag_isoc99 = 0; 533 flag_bsd_format = 0; | 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; |
|
534 } 535 else if (!strcmp (argstart, "iso9899:199409")) 536 { 537 flag_isoc94 = 1; 538 goto iso_1994; 539 } 540 else if (!strcmp (argstart, "iso9899:199x") 541 || !strcmp (argstart, "iso9899:1999") 542 || !strcmp (argstart, "c9x") 543 || !strcmp (argstart, "c99")) 544 { 545 flag_traditional = 0; 546 flag_writable_strings = 0; 547 flag_no_asm = 1; 548 flag_no_nonansi_builtin = 1; 549 flag_noniso_default_format_attributes = 0; 550 flag_isoc99 = 1; 551 flag_isoc94 = 1; 552 flag_bsd_format = 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; |
|
553 } 554 else if (!strcmp (argstart, "gnu89")) 555 { 556 flag_traditional = 0; 557 flag_writable_strings = 0; 558 flag_no_asm = 0; 559 flag_no_nonansi_builtin = 0; 560 flag_noniso_default_format_attributes = 1; 561 flag_isoc99 = 0; 562 flag_isoc94 = 0; 563 flag_bsd_format = 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; |
|
564 } 565 else if (!strcmp (argstart, "gnu9x") || !strcmp (argstart, "gnu99")) 566 { 567 flag_traditional = 0; 568 flag_writable_strings = 0; 569 flag_no_asm = 0; 570 flag_no_nonansi_builtin = 0; 571 flag_noniso_default_format_attributes = 1; 572 flag_isoc99 = 1; 573 flag_isoc94 = 1; 574 flag_bsd_format = 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; |
|
575 } 576 else if (!strcmp (argstart, "bsd")) 577 { 578 flag_traditional = 0; 579 flag_writable_strings = 0; 580 flag_no_asm = 0; 581 flag_no_nonansi_builtin = 0; 582 flag_noniso_default_format_attributes = 1; 583 flag_isoc99 = 0; 584 flag_isoc94 = 0; 585 flag_isoc94 = 0; 586 flag_bsd_format = 1; | 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; |
|
587 } 588 else 589 error ("unknown C standard `%s'", argstart); 590 } 591 else if (!strcmp (p, "-fdollars-in-identifiers")) 592 dollars_in_ident = 1; 593 else if (!strcmp (p, "-fno-dollars-in-identifiers")) 594 dollars_in_ident = 0; --- 5713 unchanged lines hidden (view full) --- 6308 old_decl = IDENTIFIER_IMPLICIT_DECL (DECL_NAME (decl1)); 6309 6310 /* Optionally warn of old-fashioned def with no previous prototype. */ 6311 if (warn_strict_prototypes 6312 && TYPE_ARG_TYPES (TREE_TYPE (decl1)) == 0 6313 && !(old_decl != 0 6314 && (TYPE_ARG_TYPES (TREE_TYPE (old_decl)) != 0 6315 || (DECL_BUILT_IN (old_decl) | 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))))) |
6317 warning ("function declaration isn't a prototype"); 6318 /* Optionally warn of any global def with no previous prototype. */ 6319 else if (warn_missing_prototypes 6320 && TREE_PUBLIC (decl1) 6321 && !(old_decl != 0 6322 && (TYPE_ARG_TYPES (TREE_TYPE (old_decl)) != 0 6323 || (DECL_BUILT_IN (old_decl) 6324 && ! C_DECL_ANTICIPATED (old_decl)))) --- 1200 unchanged lines hidden --- | 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 --- |