This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: flag_external and DECL_EXTERNAL documentation
- To: gcc-patches at gcc dot gnu dot org
- Subject: PATCH: flag_external and DECL_EXTERNAL documentation
- From: Lars Brinkhoff <lars at nocrew dot org>
- Date: 31 Jan 2001 10:30:50 +0100
- Organization: nocrew
The documentation for DECL_EXTERNAL in tree.h:
/* In a VAR_DECL or FUNCTION_DECL,
nonzero means external reference:
do not allocate storage, and refer to a definition elsewhere. */
#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag)
doesn't agree with the code in c-decl.c:
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
/* Every function declaration is "external"
except for those which are inside a function body
in which `auto' is used.
That is a case not specified by ANSI C,
and we use it for forward declarations for nested functions. */
int extern_ref = (!(specbits & (1 << (int) RID_AUTO))
|| current_binding_level == global_binding_level);
[...]
if (extern_ref)
DECL_EXTERNAL (decl) = 1;
2001-01-31 lars brinkhoff <lars@nocrew.org>
* tree.h (external_flag): add documentation.
(DECL_EXTERNAL): update comment.
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.222
diff -u -r1.222 tree.h
--- tree.h 2001/01/30 01:38:41 1.222
+++ tree.h 2001/01/31 09:27:03
@@ -266,6 +266,13 @@
expressions, VAR_DECL, PARM_DECL, FIELD_DECL, FUNCTION_DECL
TYPE_BOUNDED in
..._TYPE
+
+ external_flag:
+
+ DECL_EXTERNAL in
+ VAR_DECL, FUNCTION_DECL
+ TYPE_DECL_SUPRESS_DEBUG in
+ TYPE_DECL
*/
/* Define accessors for the fields that all tree nodes have
@@ -1418,9 +1425,10 @@
/* Language-specific decl information. */
#define DECL_LANG_SPECIFIC(NODE) (DECL_CHECK (NODE)->decl.lang_specific)
-/* In a VAR_DECL or FUNCTION_DECL,
- nonzero means external reference:
- do not allocate storage, and refer to a definition elsewhere. */
+/* In a VAR_DECL, nonzero means external reference:
+ do not allocate storage, and refer to a definition elsewhere.
+ In a FUNCTION_DECL, zero means that the function is declared auto
+ inside a function body. */
#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag)
/* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority