Merge FreeBSD modifications into gcc 3.2.1-prerelease:
1.2 kernel printf enchancements framework 1.3 suppress warnings on K&R main Approved by: obrien
This commit is contained in:
parent
f3575d94a6
commit
449bacd8c3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102790
@ -3944,6 +3944,7 @@ build_compound_literal (type, init)
|
||||
DECL_CONTEXT (decl) = current_function_decl;
|
||||
TREE_USED (decl) = 1;
|
||||
TREE_TYPE (decl) = type;
|
||||
TREE_READONLY (decl) = TREE_READONLY (type);
|
||||
store_init_value (decl, init);
|
||||
|
||||
if (TREE_CODE (type) == ARRAY_TYPE && !COMPLETE_TYPE_P (type))
|
||||
@ -3966,12 +3967,18 @@ build_compound_literal (type, init)
|
||||
if (TREE_STATIC (decl))
|
||||
{
|
||||
/* This decl needs a name for the assembler output. We also need
|
||||
a unique suffix to be added to the name, for which DECL_CONTEXT
|
||||
must be set. */
|
||||
DECL_NAME (decl) = get_identifier ("__compound_literal");
|
||||
DECL_CONTEXT (decl) = complit;
|
||||
a unique suffix to be added to the name. */
|
||||
char *name;
|
||||
extern int var_labelno;
|
||||
|
||||
ASM_FORMAT_PRIVATE_NAME (name, "__compound_literal", var_labelno);
|
||||
var_labelno++;
|
||||
DECL_NAME (decl) = get_identifier (name);
|
||||
DECL_DEFER_OUTPUT (decl) = 1;
|
||||
DECL_COMDAT (decl) = 1;
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
pushdecl (decl);
|
||||
rest_of_decl_compilation (decl, NULL, 1, 0);
|
||||
DECL_CONTEXT (decl) = NULL_TREE;
|
||||
}
|
||||
|
||||
return complit;
|
||||
@ -4650,7 +4657,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized)
|
||||
even if it is (eg) a const variable with known value. */
|
||||
size_varies = 1;
|
||||
|
||||
if (pedantic)
|
||||
if (!flag_isoc99 && pedantic)
|
||||
{
|
||||
if (TREE_CONSTANT (size))
|
||||
pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated",
|
||||
@ -5624,8 +5631,11 @@ grokfield (filename, line, declarator, declspecs, width)
|
||||
{
|
||||
/* This is an unnamed decl. We only support unnamed
|
||||
structs/unions, so check for other things and refuse them. */
|
||||
if (TREE_CODE (TREE_VALUE (declspecs)) != RECORD_TYPE
|
||||
&& TREE_CODE (TREE_VALUE (declspecs)) != UNION_TYPE)
|
||||
tree type = TREE_VALUE (declspecs);
|
||||
|
||||
if (TREE_CODE (type) == TYPE_DECL)
|
||||
type = TREE_TYPE (type);
|
||||
if (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE)
|
||||
{
|
||||
error ("unnamed fields of type other than struct or union are not allowed");
|
||||
return NULL_TREE;
|
||||
|
Loading…
Reference in New Issue
Block a user