Commit Graph

707 Commits

Author SHA1 Message Date
Andreas Schwab
f0b8d9aab4 c-common.c (truthvalue_conversion): Protect side effects in the expression when splitting a complex value.
* c-common.c (truthvalue_conversion): Protect side effects in the
	expression when splitting a complex value.
	* fold-const.c (fold): Likewise.

From-SVN: r20580
1998-06-19 01:46:50 +00:00
Andreas Schwab
bc516719ec c-common.c (check_format_info): Put back check for C9x `hh' length modifier.
* c-common.c (check_format_info): Put back check for C9x `hh'
	length modifier.  Warn about %n format writing into const.  Remove
	obsolete comment.
	(format_char_info): Fix comments.

From-SVN: r20207
1998-06-03 02:13:21 +00:00
Dave Brolley
c87248620c configure.in (extra_c_objs): add prefix.o.
Thu May 21 11:51:15 1998  Dave Brolley  <brolley@cygnus.com>
	* configure.in (extra_c_objs): add prefix.o.
	(extra_cxx_objs): extra objects for C++ with cpplib.
	* configure: Regenerate.
	* c-tree.h: (get_directive_line): Different prototype for cpplib.
	(GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
	* c-lex.h: (get_directive_line): Not needed here for cpplib.
	* c-lex.c: (yy_cur,yy_lim,yy_get_token): Move to c-common.c.
	(GET_DIRECTIVE_LINE): Move to c-common.c and rename to get_directive_line.
	* c-common.c (parse_in,parse_options,cpp_token): Declare for cpplib.
	(yy_cur,yy_lim,yy_get_token,get_directive,line): Moved here from c-lex.c

From-SVN: r19926
1998-05-21 04:54:04 -04:00
Kaveh R. Ghazi
d6f4ec5199 Warning fixes:
* Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h.
	(c-lex.o): Depend on output.h.
	(c-common.o): Likewise.
	(stmt.o): Likewise.
	(calls.o): Likewise.
	(integrate.o): Depend on toplev.h.
	(regclass.o): Depend on output.h.
	(final.o): Depend on reload.h.
	* c-common.c: Include output.h.
	(check_format_info): Remove unused variable `integral_format'.
	* c-decl.c (print_lang_decl): Mark parameters `file', `node' and
	`indent' with ATTRIBUTE_UNUSED.
	(print_lang_type): Likewise.
	(maybe_build_cleanup): Likewise for parameter `decl'.
	(copy_lang_decl): Likewise for parameter `node'.
	* c-lang.c: Include c-tree.h, c-lex.h and toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
 	with ATTRIBUTE_UNUSED.
	(lookup_interface): Likewise for parameter `arg'.
	(is_class_name): Likewise.
	(maybe_objc_check_decl): Likewise for parameter `decl'.
	(maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and
	`reflexive'.
	(maybe_objc_method_name): Likewise for parameter `decl'.
	(build_objc_string): Likewise for parameters `len' and `str'.
	* c-lex.c: Include output.h.
	* c-lex.h (position_after_white_space): Correct typo in prototype.
	* c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else,
 	c_expand_end_cond, init_iterators): Add prototypes.
	* caller-save.c (set_reg_live): Mark parameters `reg' and `setter'
	with ATTRIBUTE_UNUSED.
	* calls.c: Include output.h.
	* cccp.c (pipe_closed): Mark parameter `signo' with
 	ATTRIBUTE_UNUSED.
	* combine.c: Move inclusion of expr.h to after insn-config.h.
	* iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define
	as empty, rather define as ((void)0).
	* sparc.c (sparc_check_64): Add braces around ambiguous `else'.
	Add parentheses around assignment used as truth value.
	* cplus-dem.c (squangle_mop_up): Change return type to void.
	(internal_cplus_demangle): Remove unused parameter `options'.
	All callers changed.
	(cplus_demangle_opname): Remove function wide variable `int i' and
 	replace with `size_t i' at each location where it is used.
	(cplus_demangle_opname): change type of `i' from int to size_t.
	* cppexp.c (right_shift): Mark parameter `pfile' with
	ATTRIBUTE_UNUSED.
	* cpphash.c (cpp_lookup): Likewise.
	(cpp_hash_cleanup): Likewise.
	* cpplib.c (parse_name): Add a prototype and make it static.
	(null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED.
	(null_cleanup): Likewise for parameters `pbuf' and `pfile'.
	(macro_cleanup): Likewise for parameter `pfile'.
	(file_cleanup): Likewise.
	* cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read,
 	cpp_read_check_assertion, skip_rest_of_line): Add prototypes.
	* crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data,
	__DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED.
	* cse.c (cse_check_loop_start): Mark parameter `set' with
 	ATTRIBUTE_UNUSED.
	* dbxout.c (flag_minimal_debug, have_used_extensions,
	source_label_number): Move inside macro wrapper check against
	defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO).
	* dwarf2out.c (gen_entry_point_die): Hide prototype and definition.
	* except.h (doing_eh): Provide prototype.
	* expr.c: Move inclusion of expr.h to after insn-config.h.
	* final.c: Include reload.h.
	(shorten_branches): Cast the first argument of bzero to char *.
	* fix-header.c (cpp_print_containing_files): Mark parameter
 	`pfile' with ATTRIBUTE_UNUSED.
	(cpp_fatal): Likewise.
	* flow.c (find_basic_blocks_1): Cast the first argument of bzero
	to char *.
	* genattrtab.c (make_length_attrs): Change the type of variable
	`i' from int to size_t.
	(zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED.
	(one_fn): Likewise.
	* genextract.c (main): When generating insn-extract.c, mark
	variable `junk' with ATTRIBUTE_UNUSED.
	* gengenrtl.c (gencode): When generating genrtl.c, cast the first
	argument of bzero to char*.
	* integrate.c: Include toplev.h.
	* libgcc2.c: Wrap `struct exception_table' and
	`find_exception_handler' in macro DWARF2_UNWIND_INFO.
	* objc/Make-lang.in (objc-act.o): Depend on toplev.h.
	* objc/objc-act.c: Include toplev.h.
	(lang_print_xnode): Mark parameters `file', `node' and `indent'
	with ATTRIBUTE_UNUSED.
	(finish_protocol): Likewise for parameter `protocol'.
	* output.h (declare_weak): Add prototype.
	(decode_reg_name): Don't wrap with TREE_CODE macro.
	(assemble_alias): Add prototype.
	* regclass.c: Include output.h.
	* reload.h (reloads_conflict): Add prototype.
	* rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p,
	output_func_start_profiler): Add prototypes.
	* rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with
 	ATTRIBUTE_UNUSED.
	* scan-decls.c: Include scan.h.
	* scan.h (recognized_function, recognized_extern): Add prototypes.
	* stmt.c: Include output.h.
	* toplev.c (error_for_asm, warning_for_asm): Remove prototypes.
	(output_lang_identify): Hide prototype and definition.
	(float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED.
	(pipe_closed): Likewise.
	* toplev.h (count_error, strip_off_ending, error_for_asm,
 	warning_for_asm): Add prototypes.

From-SVN: r19712
1998-05-13 12:40:39 +00:00
Jeff Law
38e012594e typo typo fixes fixes
From-SVN: r19601
1998-05-06 15:09:07 -06:00
Kaveh R. Ghazi
e9a780ecec c-common.c: Convert to using ctype macros defined in system.h.
* c-common.c: Convert to using ctype macros defined in system.h.
        * c-lex.c: Likewise.
        * cccp.c: Likewise.
        * collect2.c: Likewise.
        * rs6000.c: Likewise.
        * cpplib.c: Likewise.
        * fix-header.c: Likewise.
        * gcc.c: Likewise.
        * gen-protos.c: Likewise.
        * pexecute.c: Likewise.
        * protoize.c: Likewise.
        * rtl.c: Likewise.
        * scan.c: Likewise.
        * stmt.c: Likewise.
        * tlink.c: Likewise.
        * toplev.c: Likewise.

From-SVN: r19579
1998-05-06 12:56:58 +00:00
Robert Lipe
5f6da3024b toplev.h: New file.
Wed May  6 06:35:38 1998  Robert Lipe  <robertl@dgii.com>
        * toplev.h: New file.   Protypes for functions in toplev.c.
        * tree.h, rtl.h: Deleted protos for functions in toplev.c.
        * c-common.c, c-convert.c, c-decl.c, c-iterate.c, c-lex.c,
        c-parse.in, c-parse.y, c-pragma.c, c-typeck.c, calls.c,
        convert.c, dwarf2out.c, except.c, expr.c, final.c, fold-const.c,
        function.c, hash.c, profile.c, real.c, reg-stack.c, regclass.c,
        reload.c, reload1.c, stmt.c, stor-layout.c, tlink.c, tree.c,
        varasm.c: include it.

From-SVN: r19563
1998-05-06 04:45:47 +00:00
Jeff Law
f5963e6170 * Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
1998-05-05 17:18:02 -06:00
Jim Wilson
c6a9dea8d5 Fix old -pedantic error I noticed while reviewing patch from Ulrich.
* c-common.c (scan_char_table): Separate 's' and 'c'.  'c' does not
	accept 'a' flag.  'S' does accept 'a' flag.
	(check_format_info): When pedantic, warn for m/C/S/a/A formats,
	and `a' flag.

From-SVN: r19545
1998-05-05 08:37:37 -07:00
Ulrich Drepper
b57062ca3d (format_char_info): Add new field hhlen.
(print_char_table, scan_char_table, time_char_table): Initialize
hhlen field appropriately.
(char_format_info): Recognize hh modifier and lookup correct char
table entry.

From-SVN: r19532
1998-05-04 20:19:33 +00:00
Kaveh R. Ghazi
753a73c846 Fix a typo:
* c-common.c (check_format_info): Don't check for the 'x' format
	character twice, instead check for 'x' and 'X'

From-SVN: r19396
1998-04-24 06:27:03 +00:00
Jeffrey A Law
a6d7e15639 c-common.c (type_for_mode): Handle TI types.
* c-common.c (type_for_mode): Handle TI types.
        * c-decl.c (intTI_type_node, unsigned_int_TI_type_node): Define.
        (init_decl_processing): Handle TI types.
        * c-tree.h (intTI_type_node, unsigned_int_TI_type_node): Declare.

From-SVN: r19355
1998-04-21 07:25:56 -06:00
Mark Mitchell
a62e870c5b c-common.c (declare_hidden_char_array): Use TYPE_DOMAIN to get the length of an array, not TREE_TYPE.
1998-04-15  Mark Mitchell  <mmitchell@usa.net>
	* c-common.c (declare_hidden_char_array): Use TYPE_DOMAIN to get
	the length of an array, not TREE_TYPE.

From-SVN: r19233
1998-04-16 00:12:43 +00:00
Jason Merrill
72f54004c0 fix merge breakage
From-SVN: r19196
1998-04-13 07:05:58 -04:00
Paul Eggert
bb72a0843b This change is from an idea suggested by Arthur David Olson.
* c-common.c (decl_attributes, record_function_format,
	check_format_info, init_function_format_info):
	Add support for strftime format checking.
	(enum format_type): New type.
	(record_function_format): Now static, and takes value of type
	enum format_type instead of int.
	(time_char_table): New constant.
	(struct function_format_info): format_type member renamed from is_scan.
	(check_format_info): Use `warning' rather than sprintf followed by
	`warning', to avoid mishandling `%' in warnings.
	Change `pedwarn' to `warning', since these warnings do not necessarily
	mean the program does not conform to the C Standard, as the code
	need not be executed.
	* c-tree.h (record_function_format): Remove decl; no longer extern.
	* extend.texi: Add documentation for strftime format checking.

From-SVN: r19151
1998-04-12 13:52:16 -06:00
Jeff Law
e5e809f419 * Check in merge from gcc2. See ChangeLog.11 and ChangeLog.12
for details.

        * haifa-sched.c: Mirror recent changes from gcc2.

From-SVN: r18984
1998-04-04 06:32:39 -07:00
Jim Wilson
a16b4c9c69 Fix bug reported by David C Binderman, accept 'L' when pedantic with FP format.
* c-common.c (check_format_info): Initialize type, is_type.  New local
	integral_format.  Don't warn for 'L' when pedantic.  Do warn for 'L'
	when pedantic if used with integral format specifier.

From-SVN: r18827
1998-03-25 05:42:05 -08:00
Kaveh R. Ghazi
670ee92097 Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
        c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
        caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
        dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
        expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
        integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
        prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
        reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
        rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
        tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
        on system.h.
        * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
        c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
        caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
        dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
        expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
        integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
        prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
        reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
        rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
        stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
        xcoffout.c: Include system.h.  Organize include ordering so
        that stdarg/varargs comes before other system headers.  Remove
        spurious casts of functions assured of a prototype in system.h.

From-SVN: r18726
1998-03-20 14:58:42 +00:00
Brendan Kehoe
d9525bec09 tree.h (merge_machine_{type,decl}_attributes): Declare.
./ChangeLog:	* tree.h (merge_machine_{type,decl}_attributes): Declare.
	(split_specs_attrs, strip_attrs): Add prototypes.
	* tree.c (merge_machine_{type,decl}_attributes): New functions.
	* c-decl.c (duplicate_decls): Call merge_machine_decl_attributes.
	Update olddecl's attributes too.
	* c-common.c (strip_attrs): New function.
	* c-typeck.c (common_type): Call merge_machine_type_attributes.
	* varasm.c (make_function_rtl): New target macro REDO_SECTION_INFO_P.
	(make_decl_rtl): Likewise.
	* c-decl.c (shadow_tag_warned): Call split_specs_attrs.
./cp/ChangeLog:	* decl.c (duplicate_decls): Call merge_machine_decl_attributes.
	Update olddecl's attributes too.
	(strip_attrs): Remove function.
	* typeck.c (common_type): Call merge_machine_type_attributes.

From-SVN: r18065
1998-02-18 05:38:57 -05:00
Bernd Schmidt
0a7ed33c87 c-common.c (c_expand_start_cond, [...]): Don't warn about non-ambiguous else even if braces are missing.
* c-common.c (c_expand_start_cond, c_expand_end_cond,
        c_expand_start_else): Don't warn about non-ambiguous else even if
        braces are missing.

From-SVN: r18055
1998-02-17 15:28:23 -07:00
Robert Lipe
ccd043a956 c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
* c-common.c: Include <stdlib.h> and <string.h>/<strings.h>.
        * calls.c (expand_call): Remove unused variables funtree,
        n_regs, and tmpmode.
        * dbxout.c, except.c: Include <string.h>/<strings.h>.
        * explow.c: (plus_constant_for_output_wide) Removed unused
        variable all_constant.
        * c-decl.c, genattr.c, genattrtab.c, getconfig.c, genemit.c
        genextract.c, genflags.c, genopinit.c genoutput.c, genpeep.c,
        genrecog.c, global.c, integrate.c , stupid.c : Include
        <stdlib.h>.
        * genextract.c: (walk_rtx) Remove unused variable link.
        * genrecog.c: (concat) Remove unreferenced static function.
        * prefix.c: Include <string.h>/<strings.h>, <stdlib.h>
        * stmt.c: Include <stdlib.h>.
        (expand_asm_operands): Remove unused variable val1.
        (expand_return): Remove unused variable block.
        (pushcase): Remove unused variables l and n.
        (pushcaserange): Likewise.
        * unroll.c (unroll_loop): Remove unused variable temp.

From-SVN: r17766
1998-02-07 15:55:54 -07:00
Mumit Khan
6d819282d0 c-common.c (decl_attributes): Flag unrecognized attribute functions as warnings instead of as errors.
* c-common.c (decl_attributes): Flag unrecognized attribute
        functions as warnings instead of as errors.

From-SVN: r17672
1998-02-05 13:54:49 -07:00
Richard Kenner
3ab1999b99 (c_build_type_variant): Don't futz with main type variant of array since C...
(c_build_type_variant): Don't futz with main type variant of array
since C Standard requires main type variant of array-of-const also be
array-of-const.

From-SVN: r14195
1997-06-09 18:37:37 -04:00
Richard Kenner
f9dcab5273 (check_format_info): Correct handling of the 'a' flag which adds
another pointer level.

From-SVN: r14176
1997-06-09 09:09:05 -04:00
Jason Merrill
a1d7ffe39c x
From-SVN: r13652
1997-02-16 10:05:43 +00:00
Richard Kenner
e78a3b4249 (skip_evaluation): Likewise.
(overflow_warning, unsigned_conversion_warning): Don't warn about
potential runtime errors when skipping evaluation.

From-SVN: r13233
1996-12-07 17:51:24 -05:00
Richard Kenner
5d9dd5a55a (decl_attributes, case A_ALIAS): Add missing parens.
From-SVN: r13162
1996-11-15 12:11:24 -05:00
Richard Kenner
800f4153ad (split_specs_attrs): New function.
From-SVN: r12925
1996-10-09 07:35:43 -04:00
Richard Kenner
f4ca236c56 (decl_attribtes, case A_SECTION): Allow for static local variable.
From-SVN: r12774
1996-09-22 21:06:39 -04:00
Richard Kenner
31837ce2fc (record_function_format): Define as static.
From-SVN: r12391
1996-07-03 18:21:37 -04:00
Mike Stump
0f41302f47 formatting tweaks
From-SVN: r12390
1996-07-03 22:07:53 +00:00
Richard Kenner
e5ee0060c6 (check_format_info): Change text of message about use of `0' with
precision.

From-SVN: r12277
1996-06-11 17:50:55 -04:00
Richard Kenner
62b1077c62 (decl_attributes, case A_T_UNION): Don't look at fields of union if
there aren't any.

From-SVN: r12256
1996-06-10 11:29:39 -04:00
Richard Kenner
0161e8dace (enum attrs): Add A_FORMAT_ARG.
(init_attribute): Initialize it.
(decl_attributes, case A_FORMAT): Clean up error messages.
(decl_attributes, case A_FORMAT_ARG): New case.
(struct international_format_info): New structure and typedef.
(international_format_list): New variable.
(record_international_format): New function.
(init_format_info): Call it for gettext, dcgettext, and dcgettext.
(check_format_info): See if format arg is call to internationalization
function.

From-SVN: r12241
1996-06-08 13:35:57 -04:00
Stan Cox
17c1a44f75 (decl_attributes): Chain multiple attributes correctly.
From-SVN: r11942
1996-05-06 20:58:44 +00:00
Richard Kenner
fc0c675f04 (truthvalue_conversion, case ADDR_EXPR): Don't treat address of
external decl as always nonzero.

From-SVN: r11941
1996-05-06 15:41:35 -04:00
Jason Merrill
2786cbadc7 -fno-common change
From-SVN: r11940
1996-05-06 18:36:48 +00:00
Richard Kenner
80d390a260 Install latest version of last patch.
From-SVN: r11293
1996-02-18 19:26:39 -05:00
Richard Kenner
15cf7c831e (check_format_info): Warn about `L' if -pedantic.
From-SVN: r11291
1996-02-18 13:29:45 -05:00
Richard Kenner
f33f79c0fd (overflow_warning): Fix typo in warning message.
From-SVN: r11268
1996-02-13 18:16:06 -05:00
Richard Kenner
69c3716d7c (check_format_info): Handle missing type in format when terminated by
a new `%'.

From-SVN: r11203
1996-02-11 08:44:40 -05:00
Doug Evans
05a81fe58a c-lex.c (check_newline): Pass character after `#pragma' to HANDLE_PRAGMA.
* c-lex.c (check_newline): Pass character after `#pragma' to
	HANDLE_PRAGMA.  Don't call get_directive_line if at end of line.
	* c-common.c (get_directive_line): Watch for EOF.
	* h8300/h8300.h (HANDLE_PRAGMA): New argument `c'.
	Must issue `return' now.
	* i960/i960.h (HANDLE_PRAGMA): Likewise.
	* sh/sh.h (HANDLE_PRAGMA): Likewise.
	* nextstep.h (HANDLE_PRAGMA): Likewise.
	* h8300/h8300.c (handle_pragma): New argument `ch'.
	Simplify pragma processing.  Delete support for `#pragma section'.
	* i960/i960.c (process_pragma): New argument `c'.  Change result to
	terminating character.
	* nextstep.c (handle_pragma): Likewise.
	* sh/sh.c (handle_pragma): Likewise.  Also simplified.

From-SVN: r10999
1996-01-15 22:25:24 +00:00
Richard Kenner
54630035ff (decl_attributes): Fix default alignment: BIGGEST_ALIGNMENT is a
number of bits, not bytes.

From-SVN: r10929
1996-01-01 16:15:08 -05:00
Jim Wilson
fef610bec3 (WCHAR_TYPE_SIZE): Add a default definition.
From-SVN: r10806
1995-12-18 16:13:24 -08:00
Jim Wilson
41bbd14edc (combine_strings): Add support for WCHAR_TYPE as short.
From-SVN: r10622
1995-11-29 11:05:42 -08:00
Richard Kenner
39b751ce5a (check_format_info): Make test for null pointer more general.
From-SVN: r10479
1995-10-19 19:18:59 -04:00
Richard Kenner
8741664047 (check_format_info): Don't warn about format type mismatch if the
argument is an ERROR_MARK.

From-SVN: r10401
1995-09-26 16:36:10 -04:00
Richard Kenner
1bcf5b08b0 (decl_attribute, case A_PACKED): Check is_type first.
(decl_attribute, case A_T_UNION): Likewise.
Don't access TYPE_FIELDS if DECL is zero.

From-SVN: r10292
1995-08-29 19:15:19 -04:00
Richard Kenner
06aa52de3c (decl_attributes, case A_ALIGNED): Handle is_type case properly.
From-SVN: r10146
1995-07-18 19:11:10 -04:00
Richard Kenner
1a16a053da (decl_attributes, case A_CONSTRUCTOR, A_DESTRUCTOR): Set TREE_USED.
From-SVN: r10064
1995-06-27 16:42:57 -04:00
Richard Kenner
940d9d638b Update FSF address.
From-SVN: r9959
1995-06-15 07:33:25 -04:00
Richard Kenner
2a13575e8a (format_char_info, case 'm'): Set type to void.
(check_format_info): If type is void, ignore operand.

From-SVN: r9954
1995-06-14 17:39:03 -04:00
Richard Kenner
3438dff9b0 (decl_attributes): Fix typo in size passed to alloca.
From-SVN: r9874
1995-06-05 08:14:46 -04:00
Richard Kenner
58cee64304 (truthvalue_conversion, BIT_AND_EXPR): Make sure that the result has
boolean_type_node.

From-SVN: r9844
1995-05-31 07:31:46 -04:00
Jason Merrill
1180eb1042 *** empty log message ***
From-SVN: r9801
1995-05-24 19:41:29 +00:00
Richard Kenner
868fc7506b (convert_and_check): Don't diagnose overflow in constant expression
merely because conversion overflowed.

From-SVN: r9626
1995-05-11 18:48:51 -04:00
Jason Merrill
d2eb08764b (declare_hidden_char_array): Mark decl artificial.
From-SVN: r9594
1995-05-09 10:06:32 +00:00
Richard Kenner
1c4fadec37 (enum attrs): Add A_UNUSED.
(init_attributes): Initialize it.
(decl_attributes, case A_UNUSED): New case.

From-SVN: r9545
1995-04-30 07:13:38 -04:00
Doug Evans
6eaba4a70a (decl_attributes): Always continue if attribute not found.
From-SVN: r9522
1995-04-28 01:09:12 +00:00
Richard Kenner
a89ca5c67e (init_attributes): Don't require decl for A_PACKED.
(decl_attributes, case A_PACKED): Set TYPE_PACKED for type.

From-SVN: r9485
1995-04-26 17:23:10 -04:00
Jason Merrill
4b8af8d984 attributes weak and alias
From-SVN: r9391
1995-04-16 06:14:00 +00:00
Richard Kenner
bbb1ae016c (enum attrs): New attribute, A_NOCOMMON.
(init_attribute): Initialize it.
(decl_attributes): Implement it.

From-SVN: r9347
1995-04-10 08:20:09 -04:00
Richard Kenner
d161fae48b (init_attributes): A_FORMAT is only for decls.
From-SVN: r9271
1995-03-31 07:26:28 -05:00
Richard Kenner
5306559682 (enum attrs): New enum class.
(attrtab, attrtab_idx): New variables.
(add_attribute, init_attributes): New functions.
(decl_attributes): Major rewrite.

From-SVN: r9261
1995-03-30 08:59:11 -05:00
Richard Kenner
515f0e729a (decl_attributes): Clean up test for __mode__.
From-SVN: r9241
1995-03-29 06:47:28 -05:00
Richard Kenner
d3e0f18932 (decl_attributes): Allow alignment for TYPE_DECLs.
From-SVN: r9195
1995-03-16 17:24:31 -05:00
Richard Kenner
eed328336c (decl_attributes): Handle prefix and suffix attributes the same way.
From-SVN: r9152
1995-03-09 21:33:58 -05:00
Richard Kenner
1228e2a6b2 (decl_attributes): Add third argument prefix_attributes.
(valid_machine_attribute): Deleted; moved to tree.c.

From-SVN: r8993
1995-02-21 17:55:41 -05:00
Jason Merrill
a311b52c43 (type_for_*): Check integer_type_node first.
From-SVN: r8840
1995-01-31 00:40:42 +00:00
Jason Merrill
a360da3a3d Use boolean_* instead of integer_* where appropriate.
From-SVN: r8768
1995-01-17 21:43:40 +00:00
Doug Evans
767880cde6 Add 1995 to copyright.
From-SVN: r8760
1995-01-14 06:27:58 +00:00
Doug Evans
23c97802de (decl_attributes): Fix typo in packed ignored warning.
Fix unrecognized mode warning.  Make string comparisons consistent.
Support machine attributes with arguments.  Make noreturn/volatile
warnings consistent with others.

From-SVN: r8757
1995-01-14 06:20:26 +00:00
Jason Merrill
2c5f4139a9 __attribute__ ((constructor))
From-SVN: r8747
1995-01-14 01:09:01 +00:00
Richard Kenner
caab5771c8 (decl_attribute): Allow special names (e.g, `word') for mode
attribute.

From-SVN: r8582
1994-11-30 15:48:00 -05:00
Richard Kenner
4cc00c5a1c (print_char_table): Allow L' for u'.
From-SVN: r8477
1994-11-17 11:06:36 -05:00
Richard Kenner
ca854c0526 (decl_attributes): Add double-underscore version of printf and scanf
for format type.

From-SVN: r8426
1994-11-11 17:07:25 -05:00
Richard Kenner
55960f52ea (decl_attributes): Check for attributes with leading and trailing
double underscores.

From-SVN: r8412
1994-11-10 18:02:50 -05:00
Richard Kenner
2cedb812b4 ({print,scan}_char_table): Allow `L' modifier for integer output formats.
(check_format_info): Treat `ll' like `q'.

From-SVN: r8409
1994-11-10 15:55:49 -05:00
Charles Hannum
2314fb7008 Add format checking for `q' (quad) modifier.
From-SVN: r8093
1994-09-19 12:46:40 +00:00
Jason Merrill
6acfe908e3 (min_precision): Move from c-decl.c
From-SVN: r8020
1994-09-02 23:40:51 +00:00
Richard Kenner
5af6001b5e (shorten_compare): Don't issue warning if both operands constants and the...
(shorten_compare): Don't issue warning if both operands constants and
the signedness doesn't affect the comparison results.

From-SVN: r7981
1994-08-25 17:43:46 -04:00
Richard Kenner
ec83f2b381 (decl_attribute): Handle "transparent_union" attribute.
From-SVN: r7947
1994-08-19 17:32:52 -04:00
Richard Earnshaw
20250c072b (decl_attributes): If TREE_TYPE for the DECL is updated,
then update TYPE as well.

From-SVN: r7662
1994-07-06 09:07:10 +00:00
Richard Kenner
084b6d7b05 (c_build_type_variant): Remove last change; instead, copy TYPE if not
in old obstack.

From-SVN: r7618
1994-06-30 06:24:28 -04:00
Doug Evans
f58e9815f7 (decl_attributes): Fix section attribute breakage.
From-SVN: r7440
1994-06-03 22:12:54 +00:00
Richard Kenner
ba5ce70d08 (c_build_type_variant): Don't change TYPE_MAIN_VARIANT of new type.
From-SVN: r7427
1994-06-02 17:31:34 -04:00
Jason Merrill
fb48b1f0d3 (truthvalue_conversion): If expr is a BIT_AND_EXPR
where one of the operands is integer_onep, just return expr.

From-SVN: r7293
1994-05-13 20:30:24 +00:00
Richard Kenner
389da36245 (decl_attributes): Revert to identifiers for mode attributes.
From-SVN: r7281
1994-05-12 15:48:11 -04:00
Richard Kenner
a2cd7b4554 (decl_attributes): Move the attribute recognition and rejection here from c-parse.in.
(decl_attributes): Move the attribute recognition and rejection here from
c-parse.in.
(decl_attributes): Use VALID_MACHINE_ATTRIBUTE macro.

From-SVN: r7256
1994-05-06 18:32:17 -04:00
Richard Stallman
838e9ea20d (decl_attributes): `mode' attribute now takes string arg.
From-SVN: r6914
1994-03-28 01:28:04 +00:00
Richard Kenner
c4e8f305b4 (truthvalue_conversion): Remove decl of unused CODE.
From-SVN: r6871
1994-03-25 13:55:26 -05:00
Jim Wilson
597681f6d1 (shorten_compare): When simplify compare against
zero, check for restype_ptr unsigned instead of primop0 unsigned.

From-SVN: r6806
1994-03-17 15:39:11 -08:00
Richard Kenner
18c0f6759f (TRUTH_*_EXPR): Convert to integer_type_node.
From-SVN: r6772
1994-03-13 21:16:59 -05:00
Richard Kenner
c05f751c24 (constant_expression_warning, overflow_warning): Handle REAL_CST and
COMPLEX_CST.

From-SVN: r6769
1994-03-13 08:31:27 -05:00
Richard Kenner
700942a0c6 (declare_hidden_char_array): Build new type if warn_larger_than.
From-SVN: r6654
1994-02-27 15:20:28 -05:00
Richard Kenner
89c78d7d37 (binary_op_error): Initialize OPNAME.
From-SVN: r6636
1994-02-27 10:42:51 -05:00
Richard Kenner
a0b25e45b7 (decl_attributes): Warn if attribute will be ignored.
Allow `noreturn', `volatile', and `const' on object of type pointer to
function.
Always give decl with error or warning.

From-SVN: r6610
1994-02-23 07:29:42 -05:00
Doug Evans
5289b66589 (decl_attributes): Decode section attribute.
From-SVN: r6582
1994-02-17 22:48:50 +00:00
Richard Kenner
09e3dd7232 (decl_attributes): Allow format attributes on old style
(non-prototype) function declarations.

From-SVN: r6463
1994-02-01 18:56:12 -05:00
Richard Kenner
6f38f669d0 (decl_attribute): Verify that alignment and format argument numbers are all integer constants.
(decl_attribute): Verify that alignment and format argument numbers are all
integer constants.
Continue on to next attribute if one is in error.

From-SVN: r6300
1993-12-24 07:38:37 -05:00
Richard Kenner
df8a401ad5 (T_ST): Fix typo in last change.
From-SVN: r6284
1993-12-23 17:19:33 -05:00
Richard Kenner
af3c5588ab (T_ST): New macro.
(scan_char_table): With s, c and [, allow `a' flag.
(print_char_table): Accept Z and m codes.
(check_format_info): Handle the `a' flag.

From-SVN: r6258
1993-12-22 07:11:59 -05:00
Richard Stallman
b7c9c707a6 (shorten_compare): Correct typo from last change.
From-SVN: r6157
1993-11-24 23:14:43 +00:00
Richard Kenner
f577532561 (check_format_info): When we have INTEGER_TYPEs...
(check_format_info): When we have INTEGER_TYPEs, save result of
signed_type or unsigned_type for later comparison with the various
forms of char types.

From-SVN: r6146
1993-11-23 17:32:21 -05:00
Richard Stallman
309ffab61f (check_format_info): Make warning nicer for mismatch of int vs long, etc.
Don't warn if field width is an unsigned int.

From-SVN: r5981
1993-11-03 20:09:12 +00:00
Richard Stallman
94dccd9d27 (shorten_compare): Undo previous change.
Instead, just suppress warnings if both args are constant.

From-SVN: r5957
1993-10-31 20:19:31 +00:00
Richard Stallman
8396a8d6fa (shorten_compare): Do nothing if both args constant.
From-SVN: r5954
1993-10-31 03:13:52 +00:00
Richard Stallman
22ba338b8f (convert_and_check): Don't warn converting 0xff
to a signed char, etc., unless pedantic.

From-SVN: r5944
1993-10-30 08:34:05 +00:00
Richard Kenner
60e02b1e4e (check_format_info): Consider "char", "signed char", and "unsigned
char" types as equivalent.

From-SVN: r5849
1993-10-20 21:44:35 -04:00
Richard Kenner
9b69f523a7 (check_format_info): Support X/Open formats like "%1$d".
From-SVN: r5707
1993-10-10 08:56:49 -04:00
Richard Stallman
4215e49850 (check_format_info): Avoid ?: conditional for function to be called.
From-SVN: r5704
1993-10-10 05:28:35 +00:00
Richard Kenner
95216deccf (check_function_format): Correct error in last change.
From-SVN: r5680
1993-10-08 10:40:59 -04:00
Richard Kenner
1ccf251f97 Include <ctype.h>; avoid home-grown ISDIGIT.
(decl_attributes): Call record_function_format with DECL_NAME and also
DECL_ASSEMBLER_NAME.
(struct format_char_info): Moved here from c-typeck.c.
(print_char_table): Likewise; renamed from print_table.
(scan_char_table): Likewise; renamed from scan_table.
(struct function_format_info): Likewise; add assembler_name.
(function_format_list): Make list, not array.
(init_function_format_info): Likewise; renamed from init_format_info_table.
(record_function_format): Likewise; renamed from record_format_info;
record assembler_name.
(check_format_info): Likewise; renamed from check_format.
(check_function_format): New interface that does not require knowledge of
struct function_format_info.

From-SVN: r5607
1993-10-05 15:14:50 -04:00
Richard Kenner
90b5a681ce (c_build_type_variant): Allocate new type in same obstack as old one.
From-SVN: r5278
1993-09-07 19:11:15 -04:00
Richard Kenner
b839fb3fe9 (truthvalue_conversion): A complex value is nonzero if either part is
nonzero, not if both parts are nonzero.

From-SVN: r5259
1993-09-04 11:16:10 -04:00
Richard Stallman
4724b3dea0 (declare_hidden_char_array): New function to factor out duplicate code in declare_function_name.
(declare_hidden_char_array): New function to
factor out duplicate code in declare_function_name.
Don't set DECL_EXTERNAL (which is illegal without TREE_PUBLIC)
to prevent output; instead, set TREE_ASM_WRITTEN.

(declare_function_name): Use declare_hidden_char_array.

From-SVN: r5161
1993-08-15 09:30:20 +00:00
Richard Stallman
34d6bae3ee (declare_function_name): Set DECL_EXTERNAL in the decls.
From-SVN: r5106
1993-08-08 08:33:48 +00:00
Richard Stallman
3550617cd5 (decl_attributes): Support attributes `volatile'
with alias `noreturn', and `const'.

From-SVN: r5082
1993-08-06 01:08:12 +00:00
Paul Eggert
90c939d4ee (unsigned_conversion_warning): Just use `warning',
not `pedwarn'; these diagnostics are not required by Standard C.

From-SVN: r4909
1993-07-12 21:10:27 +00:00
Paul Eggert
7193bce22f (constant_expression_warning, overflow_warning,
convert_and_check): Distinguish between TREE_OVERFLOW, which is just
for warnings, and TREE_CONSTANT_OVERFLOW, which is for required
pedantic diagnostics.

From-SVN: r4827
1993-07-02 01:26:01 +00:00
Richard Stallman
68a91d8d3a (decl_attributes): If first_arg_num is 0, no error for it.
From-SVN: r4720
1993-06-24 03:36:08 +00:00
Richard Stallman
14aadfe88a (constant_expression_warning)
(overflow_warning, convert_and_check): Change pedwarn to warning.

From-SVN: r4529
1993-05-21 19:31:40 +00:00
Richard Stallman
d7c837272e (truthvalue_conversion): Turn off Apr 29 change.
From-SVN: r4356
1993-05-06 15:58:59 +00:00
Jim Wilson
f87550e01b (truthvalue_conversion): Don't optimize subtract of reals when target uses
IEEE arithmetic.

From-SVN: r4311
1993-05-03 16:33:42 -07:00
Richard Stallman
257e61ed70 (truthvalue_conversion): Specific error message when the "truthvalue" of a struct...
(truthvalue_conversion):  Specific error message when the
"truthvalue" of a struct, union, or array type operand is needed.

From-SVN: r4293
1993-05-01 04:09:06 +00:00
Jim Wilson
677ff44144 (decl_attributes...
(decl_attributes, format case): Error if num_arg does
not point to a string type argument, or if first_arg_num not the
anonymous argument.

From-SVN: r4032
1993-04-06 12:30:45 -07:00
Richard Stallman
1bb8e5b1b8 #include "obstack.h".
From-SVN: r3811
1993-03-21 18:58:22 +00:00
Richard Stallman
f0b996c50c (truthvalue_conversion): Fix handling of COMPLEX_EXPR.
Handle all complex values specially.

From-SVN: r3645
1993-03-04 20:34:56 +00:00
Richard Stallman
766f6c304d (truthvalue_conversion): Handle COMPLEX_EXPR.
From-SVN: r3638
1993-03-04 19:36:42 +00:00
Richard Stallman
d74154d508 (constant_expression_warning): Suppress duplicate warnings.
(convert_and_check, overflow_warning, unsigned_conversion_warning):
New functions.  Prototypes added to c-tree.h.

From-SVN: r3405
1993-02-02 04:40:43 +00:00
Niklas Hallqvist
0b73773ce6 c-common.c (c_build_type_variant): Moved here from c-decl.c.
* c-common.c (c_build_type_variant): Moved here from c-decl.c.
	Redirected the TYPE_MAIN_VARIANT to the "real" main variant.
	Build the possibly new array type on the permanent obstack if it
        the original type was permanent.
	(permanent_obstack): Added extern declaration.

From-SVN: r3388
1993-01-30 06:06:09 +00:00
Richard Kenner
97d17ac21c (declare_function_name): If char_array_type_node isn't large enough
for the name, make a larger type.

From-SVN: r3368
1993-01-27 19:21:01 -05:00
Richard Kenner
9379fac9a2 (truthvalue_conversion): Handle TRUTH_XOR_EXPR.
From-SVN: r2993
1992-12-30 06:01:57 -05:00
Richard Stallman
b9a24ad42e (declare_function_name): __FUNC__ variables
are compiler-created, so set DECL_SOURCE_LINE to zero.

From-SVN: r2300
1992-10-01 19:01:26 +00:00
Richard Stallman
6152f87688 (declare_function_name): Allow for anonymous function.
From-SVN: r2095
1992-09-10 05:33:47 +00:00
Brendan Kehoe
9657188305 Moved constant_expression_warning into c-common.c.
From-SVN: r2076
1992-09-07 19:42:39 -04:00
Richard Stallman
bc690db148 (check_case_value): Call constant_expression_warning.
From-SVN: r2070
1992-09-07 06:07:30 +00:00
Richard Stallman
e2aab13d8a (truthvalue_conversion): Optionally warn if an
unparenthesized assignment is used as a truth value.

From-SVN: r1853
1992-08-14 23:45:09 +00:00
Richard Stallman
ef57b1e9f0 (decl_attributes): Call layout_decl with two arguments.
From-SVN: r1711
1992-07-29 03:46:49 +00:00
Richard Stallman
1394aabdaa Renamed TREE_INLINE...
Renamed TREE_INLINE, TREE_NONLOCAL, TREE_REGDECL, TREE_EXTERNAL
to DECL_INLINE, DECL_NONLOCAL, DECL_REGISTER, DECL_EXTERNAL.

From-SVN: r1569
1992-07-12 02:56:45 +00:00
Richard Stallman
8493738bcc (check_case_value): Strip the new nops with STRIP_TYPE_NOPS.
From-SVN: r1549
1992-07-10 01:50:20 +00:00
Richard Kenner
18a799ccb1 Changes to support 64-bit hosts: Remove definition of NULL.
From-SVN: r1494
1992-07-06 22:02:07 -04:00
Richard Stallman
176e81ebf9 > (declare_function_name): For __FUNCTION__ and __PRETTY_FUNCTION__...
> (declare_function_name): For __FUNCTION__ and __PRETTY_FUNCTION__,
set DECL_IN_SYSTEM_HEADER instead  of TREE_USED to supress `unused' warnings.

From-SVN: r1491
1992-07-07 01:46:27 +00:00
Richard Stallman
9b4e97b0d0 (decl_attributes): Don't set DECL_PACKED on VAR_DECL.
From-SVN: r1480
1992-07-06 20:45:11 +00:00
Richard Stallman
3fc7e39030 (type_for_size): If no ANSI type matches, check for matches with built-in mode-related types.
(type_for_size):  If no ANSI type matches, check for
matches with built-in mode-related types.
(type_for_mode):  Likewise.

From-SVN: r1397
1992-07-03 06:41:07 +00:00
Richard Stallman
4db3b35d80 fix typo in last change.
From-SVN: r1380
1992-07-01 21:44:28 +00:00
Richard Stallman
f3ee8ad133 (decl_attributes): For `packed' on VAR_DECL, set DECL_PACKED and DECL_ALIGN.
From-SVN: r1354
1992-06-30 02:25:17 +00:00
Richard Stallman
53e9d52c51 entered into RCS
From-SVN: r1090
1992-05-26 19:22:26 +00:00
Richard Kenner
101777b6cb *** empty log message ***
From-SVN: r1059
1992-05-22 18:08:21 -04:00
Richard Stallman
b032c74c6f *** empty log message ***
From-SVN: r1053
1992-05-22 20:41:45 +00:00
Richard Stallman
7da551a2e8 *** empty log message ***
From-SVN: r1052
1992-05-22 20:33:20 +00:00
Richard Stallman
1e307bd81a *** empty log message ***
From-SVN: r1008
1992-05-18 07:50:10 +00:00
Richard Stallman
1e276c4acc *** empty log message ***
From-SVN: r940
1992-05-08 21:25:25 +00:00
Richard Stallman
9a631e8e94 *** empty log message ***
From-SVN: r832
1992-04-25 01:51:43 +00:00
Richard Stallman
047de90b9e *** empty log message ***
From-SVN: r682
1992-04-04 19:11:28 +00:00
Richard Stallman
2525c78282 *** empty log message ***
From-SVN: r633
1992-03-30 03:20:11 +00:00
Richard Stallman
b30f223b0d Initial revision
From-SVN: r278
1992-02-04 19:51:11 +00:00