From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1796F3858D33 for ; Tue, 28 Feb 2023 23:59:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1796F3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677628750; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4MJfmCVON6jd2sg4TXzYreLEH8xnrg51sVkXlmXc80o=; b=iJrIYXW8P43Ksy7gw7OU5q05kcfjBihKEVm10qf+2pqu3dehxbtMVy4vGToiW1CzSBGhF5 rZPk/Z6xg//qS29raXY4chPbbUK0yb7IT+cmZo49FBHGiCFpKi7AokLBrjSgkv88VWnK5T zeLGjfNG9F9O6SY+tT1PJx7xNgAgiGo= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-365-yEnGzbIONOClK7lrjRT_7g-1; Tue, 28 Feb 2023 18:59:09 -0500 X-MC-Unique: yEnGzbIONOClK7lrjRT_7g-1 Received: by mail-qk1-f198.google.com with SMTP id bj3-20020a05620a190300b007422ed6c435so7003280qkb.11 for ; Tue, 28 Feb 2023 15:59:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677628749; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4MJfmCVON6jd2sg4TXzYreLEH8xnrg51sVkXlmXc80o=; b=nobWcNbVu01n009P+6kwq/oRsORHsg2qW+GWIaPJJwXoCV8bs/zYR/L1JKRaZjtiYa ofB5oU+zwKnZ1WZZrgSUG1l2B//7a03z85Gzr5bqsqyx3K9lWaRzqS7R8c/zFB1jVP9J sRZ/vW0QpjBzLxNWFLZIdBJNTZHozpFXYkysZXTL5Nuha3ZlobepeeoQu3eMmolpmi4I aCI24AffDD0ZjA9l/ikl0C2lyuCNb9nfuFufkqxhpKV/e9WcaxqTym9DLCsZRwZPwpMU hNfhSrPo7RNDYXFR/Y8jFQs9bPbTiKv6WN4bLn8s17LS/H+XONJ3E/Zi/Li45G1XTVVF C3rg== X-Gm-Message-State: AO0yUKXje3kRcV9CB8yO0okcwn7L24BJrWcqPivQOzTpJaBFyobYh5Vx d4x4Q1CpeQ4JSVQeDlnyX5jU/GiDeii7LzegDXFyC02od1c+0DC5cWwouv53YXrOhMzlv/NTM6e NRKHjVHmCaxGQ X-Received: by 2002:a05:6214:f6d:b0:56e:bc62:e164 with SMTP id iy13-20020a0562140f6d00b0056ebc62e164mr9673785qvb.8.1677628748831; Tue, 28 Feb 2023 15:59:08 -0800 (PST) X-Google-Smtp-Source: AK7set/mi2S4TgErDkaegV7cZ3mNFj46gUVg1L6P7XvR5myjQSq6VNK6Z6GMS8ZNijF7odWbGyLqUg== X-Received: by 2002:a05:6214:f6d:b0:56e:bc62:e164 with SMTP id iy13-20020a0562140f6d00b0056ebc62e164mr9673768qvb.8.1677628748550; Tue, 28 Feb 2023 15:59:08 -0800 (PST) Received: from t14s.localdomain (c-73-69-212-193.hsd1.ma.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id j63-20020a37b942000000b0073b6a06911asm7634530qkf.95.2023.02.28.15.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 15:59:08 -0800 (PST) Message-ID: Subject: Re: [GSoC][Static Analyzer] Some questions and request for a small patch to work on From: David Malcolm To: Shengyu Huang Cc: GCC Development Date: Tue, 28 Feb 2023 18:59:06 -0500 In-Reply-To: References: <960EE623-1B17-4321-B77E-FBCD9496BE1F@gmail.com> <40fbb064f56845908f797400e5d9443b6cf97fe4.camel@redhat.com> <594374fad6f19b956b3f0e6e5ce04ad51205186b.camel@redhat.com> User-Agent: Evolution 3.44.4 (3.44.4-1.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, 2023-02-28 at 10:18 +0100, Shengyu Huang wrote: > Hi Dave, >=20 > Do you want me to follow the steps 7-10 > (https://gcc-newbies-guide.readthedocs.io/en/latest/how-to-improve-th > e-location-of-a-diagnostic.html) or tell you where I add the code > simply? Basically, I added >=20 > warning_at (DECL_SOURCE_LOCATION (node->decl), 0, "hello world, I=E2=80= =99m > compiling %qE", node->decl); >=20 > to the loop of cgraph_node inside impl_run_checkrs (logger *logger) > of analyzer/engine.cc .=20 >=20 > (I also tried adding this code to cgraph_node::cgraphunit.cc > in cgraphunit.cc , and > then I found out the warning_at is different in that scope=E2=80=A6but in= form > would work.) Did you get it to output your messages? The next thing to do might be to try stepping through the code in the debugger; that's often a good way to learn about a new codebase. See: https://gcc-newbies-guide.readthedocs.io/en/latest/debugging.html and maybe have a look at the support scripts mentioned on that page. BTW, are you building trunk, or GCC 12? I've made a *lot* of changes to the analyzer in trunk, so it would be good for you to be working with something that's reasonably up-to-date. >=20 > Best, > Shengyu >=20 > P.S. Shall I continue put mailing list in my cc? Not sure the > community wants to receive that many GSoC related emails. I'd prefer to keep the mailing list involved in the conversation, as other new contributors to GCC might find the info useful, and other existing GCC contributors might have input on some of the discussion. Thanks Dave >=20 > > On 22 Feb 2023, at 16:43, David Malcolm > > wrote: > >=20 > > Sorry, I was unclear; I was referring to this part of my guide: > > https://gcc-newbies-guide.readthedocs.io/en/latest/getting-started.html= #hello-world-from-the-compiler > >=20 > > i.e. try writing a new warning that simply emits something like: > >=20 > > test.c:2:1: warning: hello world, I'm compiling 'main' > > =C2=A0=C2=A0 2 | int main () > > =C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0=C2=A0=C2=A0=C2=A0 ^~~~ > >=20 > > for each function that it sees. >=20