From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin von Loewis To: law@cygnus.com Cc: egcs@cygnus.com Subject: Re: Checking patch Date: Thu, 07 May 1998 17:39:00 -0000 Message-id: <199805071939.VAA02308@mira.isdn.cs.tu-berlin.de> References: <24558.894508708@hurl.cygnus.com> X-SW-Source: 1998-05/msg00255.html > First note -- I don't see a copyright assignment for gcc on record > with the FSF. I see you've submitted an assignment for libg++, any > objection to also submitting one for gcc (I think this change is > probably large enough to warrant an assignment). The one you have should be really for g++, as I was not sure whether different assignments are needed for g++ and gcc. Anyway, I'll sent one for gcc tomorrow, which will need the usual delay for intercontinental snail mail. > Second note -- this should have been sent to the list :-) I'll sent an updated copy RSN. [gencheck/tree-check rules] > Seems to me we should handle this in a manner similar to the > other gen* programs. Is there some particular reason you can't > use something like this? The difference is that tree-check.h is not host-dependent. So there is no need to regenerate it on the target. Instead, I'd like to see it distributed. With your scheme, it seems that gencheck is always built on the host, as s-check is not there. If always building tree-check.h (which is included by tree.h) is not a problem, a time-stamping scheme would certainly work. > Most of the other problems are formatting issues. I hope I fixed them all. > I see some things that aren't checked (EXPR_WFL_* stuff for example); > is there some reason why? Checks are only in macros that perform cast-style operations. For example, #define EXPR_WFL_NODE(NODE) TREE_OPERAND((NODE), 0) There is no cast in this macro (and neither an access to a union branch). There is such an access in TREE_OPERAND, which already contains EXPR_CHECK. Also, I believe no checks go in accesses to .common. For example, #define EXPR_WFL_FILENAME(NODE) (IDENTIFIER_POINTER ((NODE)->common.chain)) will work on any node. Of course, common.chain better contains an IDENTIFIER, which is checked inside IDENTIFIER_POINTER. There may be cases were accesses to common fields still assume specific nodes. This might be arguable, as for TREE_CHAIN, so I left them out. There might also checks for specific branches, e.g. DECL_INITIAL is defined for FUNCTION_DECL, VAR_DECL, and PARM_DECL. However, cc1plus overloads it in various ways for other _DECL nodes. I'd like to sort these non-obvious violations in a second round. > Why do we have the *_CHECK1 variants? These return NULL_TREE on failure instead of calling fatal. This is useful for combining checks. > gencheck.c uses an ANSI concatenation character (#). It doesn't really need concatenation, but stringification, to built "VAR_DECL" when given VAR_DECL. Is this also an ANSI-only feature, and if so, what is the work-around? Would it be acceptable in gcc if tree-check.h is never rebuilt by users of non-ANSI compilers? Martin