Commit Graph

707 Commits

Author SHA1 Message Date
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