From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12926 invoked by alias); 2 Feb 2007 13:14:42 -0000 Received: (qmail 12541 invoked by uid 48); 2 Feb 2007 13:14:25 -0000 Date: Fri, 02 Feb 2007 13:14:00 -0000 Message-ID: <20070202131425.12540.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug testsuite/25241] DejaGNU does not distinguish between errors and warnings In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "manu at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-02/txt/msg00148.txt.bz2 ------- Comment #18 from manu at gcc dot gnu dot org 2007-02-02 13:14 ------- (In reply to comment #13) > Manuel, I think your patch is a good idea but I'd rather have it add new > directives with different names so that developers won't be confused by having > different behavior, especially if Fortran tests need something different. I > tried changing your patch to add dg-gcc-error and dg-gcc-warning instead of > wrapping dg-error and dg-warning and it worked, at least as a starting point. My patch only changes dg-warning and dg-error for C/ObjC/C++/ObjC++ tests. Fortran and others keep using the old directives. But, yes, we could have dg-gcc-error and dg-gcc-warning. In both cases, we would need to duplicate dg-error and dg-warning. That is ugly. However, the only difference between GCC version of dg-warning/error and the original ones is the last command (lappend messages ...). Thus, it would be better to call the original, modify its return value to add "warning" or "error" at the appropriate place and then return this new value. Unfortunately, I have no idea of Tcl, so I don't know how to do this. Any ideas? > I'd like to use new directives for new tests that need them, quickly convert > the existing tests that use ugly workarounds, and gradually move other tests. The problem is that I am not 100% sure that the new directives are perfect. This last version looks better but I would like to know why each failing test is failing to spot potential problems. Once this is done, I can submit the patch using dg-gcc-warning and dg-gcc-error. Is that OK? Should my patch modify the framework or add new tests for dg-gcc-(warning|error)-(P|F) ? Tests using workarounds can be easily fixed. I have already a patch to do this. Should my patch move them also to use dg-gcc-* ? Otherwise, we remove the workaround thus allowing the test to regress without notice. > New tests should use the new directives, but with explicit help telling > developers how to use the new ones instead of the old ones. Well, how to use them is easy. dg-gcc-warning matches a "warning: ..." message while dg-gcc-error matches a "error: ..." message. Their behaviour when matching multiple lines is a bit difficult to predict. But that is not a problem because that is an issue with DejaGNU currently, since it tries to match multiple lines by default. (This cannot be solved by modifying/wrapping dg-* directives). For example, this directive: /* { dg-gcc-error "undeclared|for each function" } */ matches any of: pr8927-1.c:9: error: 'bar' undeclared (first use in this function) pr8927-1.c:9: error: (Each undeclared identifier is reported only once pr8927-1.c:9: error: for each function it appears in.) pr8927-1.c:9: error: 'bar' undeclared (first use in this function) pr8927-1.c:9: error: (Each undeclared identifier is reported only once pr8927-1.c:9: note: for each function it appears in.) but it won't match: pr8927-1.c:9: error: 'bar' undeclared (first use in this function) pr8927-1.c:9: note: (Each undeclared identifier is reported only once pr8927-1.c:9: error: for each function it appears in.) pr8927-1.c:9: error: 'bar' undeclared (first use in this function) pr8927-1.c:9: note: (Each undeclared identifier is reported only once pr8927-1.c:9: note: for each function it appears in.) pr8927-1.c:9: error: 'bar' undeclared (first use in this function) pr8927-1.c:9: error: (Each identifier is reported only once pr8927-1.c:9: note: for each function it appears in.) Maybe it will be interesting to ask now in gcc@gcc.gnu.org what people think of the new directives. > Manuel, I've been busy with other things lately but please let me know what > kinds of tests are giving you problems and I'll help look into them. Thanks > for doing this. The kind of tests that are giving me problems right now are those where a dg-warning is used to match something that is not a warning such as "cc1: ..." or "note: ..." or just a message such as "instantiated here". What are we going to do with those tests? A new directive dg-gcc-msg that matches anything in one line? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25241