From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5487 invoked by alias); 12 Dec 2003 16:24:45 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5479 invoked from network); 12 Dec 2003 16:24:42 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 12 Dec 2003 16:24:42 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hBCGOb9h001171; Fri, 12 Dec 2003 17:24:37 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hBCGObrL017522; Fri, 12 Dec 2003 17:24:37 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id hBCGOZFa017519; Fri, 12 Dec 2003 17:24:35 +0100 (CET) Date: Fri, 12 Dec 2003 16:24:00 -0000 Message-Id: <200312121624.hBCGOZFa017519@elgar.kettenis.dyndns.org> From: Mark Kettenis To: eliz@elta.co.il CC: gdb-patches@sources.redhat.com, brobecker@gnat.com In-reply-to: (message from Eli Zaretskii on 11 Dec 2003 16:34:40 +0200) Subject: Re: [PATCH/RFC] observer tests & GCC 3.4 References: <200312111355.hBBDtFE7000504@elgar.kettenis.dyndns.org> X-SW-Source: 2003-12/txt/msg00331.txt.bz2 Date: 11 Dec 2003 16:34:40 +0200 From: Eli Zaretskii > Date: Thu, 11 Dec 2003 14:55:15 +0100 (CET) > From: Mark Kettenis > > Index: ChangeLog > from Mark Kettenis > > * observer.c (observer_test_first_observer, > observer_test_second_observer, observer_test_third_observer): > Don't define as `static'. > (observer_test_first_notification_function, > observer_test_second_notification_function, > observer_test_third_notification_function): Likewise. Nitpicking: the format of the ChangeLog entries is not according to standards.texi. (See my other message today, in another thread.) Oh dear. I've been doing this the wrong way for *years*. I'll try to be a good boy from now on ;-). Anyway, I committed the attached. Mark Index: ChangeLog from Mark Kettenis * observer.c (observer_test_first_observer) (observer_test_second_observer, observer_test_third_observer): Don't define as `static'. (observer_test_first_notification_function) (observer_test_second_notification_function) (observer_test_third_notification_function): Likewise. Index: observer.c =================================================================== RCS file: /cvs/src/src/gdb/observer.c,v retrieving revision 1.3 diff -u -p -r1.3 observer.c --- observer.c 18 Mar 2003 18:05:50 -0000 1.3 +++ observer.c 12 Dec 2003 16:09:32 -0000 @@ -191,30 +191,30 @@ observer_notify_normal_stop (void) generic_observer_notify (normal_stop_subject, NULL); } -/* The following code is only used to unit-test the observers from - our testsuite. DO NOT USE IT within observer.c! */ +/* The following code is only used to unit-test the observers from our + testsuite. DO NOT USE IT within observer.c (or anywhere else for + that matter)! */ -/* Since this code will not be used within GDB, it will trigger - a warning if we decide to compile with -Wunused-function. - This is ok for now. (brobecker 2003-03-18) */ +/* If we define these variables and functions as `static', the + compiler will optimize them out. */ -static int observer_test_first_observer = 0; -static int observer_test_second_observer = 0; -static int observer_test_third_observer = 0; +int observer_test_first_observer = 0; +int observer_test_second_observer = 0; +int observer_test_third_observer = 0; -static void +void observer_test_first_notification_function (void) { observer_test_first_observer++; } -static void +void observer_test_second_notification_function (void) { observer_test_second_observer++; } -static void +void observer_test_third_notification_function (void) { observer_test_third_observer++;