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 5753B38582BD for ; Wed, 22 Feb 2023 15:43:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5753B38582BD 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=1677080625; 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=Tzc9LTaGZU/vvkZLEAJ6y2N41IdN35reSIDpKCTHgBU=; b=Uhv5wM6sUenQTM1g4iRW4UxjR09yqLCWUbJwL5jfia4uv9Fu9CKu7/p42z7f1B4D1PLdXA j67frg7ZFSxhbz13+fGWSdLNYCsOZ1pt4zCkGsLjJ+/UYmS2TzA59OG1htyPVGYpN/C1Ly gLgivEJFBxF+d7+COR/JO8bGheqFZVY= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-295-if-rPJnaMOuwmCJjmXy7ug-1; Wed, 22 Feb 2023 10:43:44 -0500 X-MC-Unique: if-rPJnaMOuwmCJjmXy7ug-1 Received: by mail-qk1-f197.google.com with SMTP id d10-20020a05620a240a00b0073baf1de8ebso4205755qkn.19 for ; Wed, 22 Feb 2023 07:43:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=Tzc9LTaGZU/vvkZLEAJ6y2N41IdN35reSIDpKCTHgBU=; b=scFVf3Op26SD1Xi79CZc+xWugHkJZOC+i4kiW7JwUEK5L0P9jZxc79uZ7W5YNZMb76 4rYduvTSftNPS9kuC1uBlcqI5A/BtG5mKKYQ4kEtWhgKPMM0Wq9gf2sle08uHcDH4K+Y RUbWl3VYJrwZn0zk8HfZPSXk9sLzXSZuMEAjK5rV0HMKDn2rhCOlGj5w+a7fF418Pgc4 Zby/FozxcQ+nYU/JSUjN4qXdBsS4NgG01A8+Kh85oNzMOj81MHbFRfj/UIixHW0CtU4s JYfmJJuvBdM3c+QtMXy+F/1Q4x+Amn11xXz7P8Xx5CO/0m3r8YQ2Wak8akDOPCg1R+h2 bI+g== X-Gm-Message-State: AO0yUKVOjlIPaJhovyz+rS0T4tfN8o1zLCBx74bU61BNuh/xFX8UhCYI oYVgXqyud3n9lrPGHeZcXxYYVwbPXXBgjQ4fDZOjnzCJcMHcBoYbhc42PHarvhW/YjNUpCXAhl5 nldmgPndYqX4I X-Received: by 2002:ac8:4e89:0:b0:3bd:18c:4f7c with SMTP id 9-20020ac84e89000000b003bd018c4f7cmr2632773qtp.45.1677080623340; Wed, 22 Feb 2023 07:43:43 -0800 (PST) X-Google-Smtp-Source: AK7set9U1869rdFxU69EP9urjXf0ZeM+untkJdnC5+yAU2E03qEn6OoVXX6Yi5vatNPuI1HxNY/QaQ== X-Received: by 2002:ac8:4e89:0:b0:3bd:18c:4f7c with SMTP id 9-20020ac84e89000000b003bd018c4f7cmr2632749qtp.45.1677080623071; Wed, 22 Feb 2023 07:43:43 -0800 (PST) Received: from t14s.localdomain (c-73-69-212-193.hsd1.nh.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id 80-20020a370653000000b006ff8a122a1asm835766qkg.78.2023.02.22.07.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Feb 2023 07:43:42 -0800 (PST) Message-ID: <594374fad6f19b956b3f0e6e5ce04ad51205186b.camel@redhat.com> Subject: Re: [GSoC][Static Analyzer] Some questions and request for a small patch to work on From: David Malcolm To: Shengyu Huang Cc: gcc@gcc.gnu.org Date: Wed, 22 Feb 2023 10:43:41 -0500 In-Reply-To: References: <960EE623-1B17-4321-B77E-FBCD9496BE1F@gmail.com> <40fbb064f56845908f797400e5d9443b6cf97fe4.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=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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 Wed, 2023-02-22 at 15:11 +0100, Shengyu Huang wrote: > Hi Dave, >=20 >=20 > > But a better place to look would probably be in our bugzilla; see > > the > > links on the wiki page: > > =C2=A0https://gcc.gnu.org/wiki/StaticAnalyzer=C2=A0 > > The "open bugs" list currently has 41 "RFE" bugs ("request for > > enhancement" i.e. ideas for new features), some of which might make > > suitable GSoC ideas, and/or be of interest to you (ideally both!) > >=20 > > Also, the GSoC wiki page has some project ideas: > > =C2=A0https://gcc.gnu.org/wiki/SummerOfCode#Selected_Project_Ideas > >=20 >=20 > Yeah I was also searching for interesting ideas on the bugzilla, and > I will communicate to you once I have any more concrete ideas. > >=20 > > If you haven't seen it yet, you might find my guide to GCC for new > > contributors helpful: > > =C2=A0https://gcc-newbies-guide.readthedocs.io/en/latest/index.html > >=20 >=20 > Just started reading it. Thanks for sharing! >=20 > > IIRC I saw you post a few days ago about trying to build gcc on > > your M2 > > laptop; did you manage this?=C2=A0 Building GCC trunk from a git > > checkout, > > and hacking in a "hello world" warning would be a great place to > > start. > > See the guide above for some hints on how to make this process > > quicker, > > and let me know if you need help if you run into difficulties.=C2=A0 > > Given > > that the analyzer is about emitting warnings, rather than > > generating > > code, it may be that although we don't yet fully support your > > hardware, > > we *might* already support it enough to allow for hacking on the > > analyzer, perhaps with some judicious choices of "configure" > > options. >=20 > I just finished building it today on my laptop (Thanks Iain!). The > GCC-12 branch did not work (I got `configure: error: C preprocessor > "/lib/cpp" fails sanity check`) but the development branch works for > me (haven=E2=80=99t encountered the potential pitfalls mentioned yet afte= r > testing it with some simple programs). Besides, I have also set up > everything on both my university server and the compile farm machine, > so I can test my work on these two machines as well. >=20 > What do you mean by a =E2=80=9Chello world=E2=80=9D warning? You meant to= write some > simple code like >=20 > ``` > #include > int main () > { > =C2=A0 int a; > =C2=A0 printf ("hello world\n"); > =C2=A0 return a; > } > ``` >=20 > and to get the warning =E2=80=9Cwarning: use of uninitialized value =E2= =80=98a=E2=80=99 [CWE- > 457] [-Wanalyzer-use-of-uninitialized-value]=E2=80=9D?=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#hel= lo-world-from-the-compiler i.e. try writing a new warning that simply emits something like: test.c:2:1: warning: hello world, I'm compiling 'main' 2 | int main () | ^~~~ for each function that it sees. That way you can easily see that you've modified the compiler, that your code is running inside it. Dave