From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1.systemli.org (mail1.systemli.org [93.190.126.36]) by sourceware.org (Postfix) with ESMTPS id D2E1F3858C33 for ; Wed, 24 Aug 2022 20:51:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2E1F3858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=systemli.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=systemli.org Message-ID: <340e1f2d-ffd6-6b28-aa5e-3d3f3a535f07@systemli.org> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemli.org; s=default; t=1661374276; bh=UNlFpvkz+87fEdTEy8pWSxxQfiSx9SCCygJtYmW0ltE=; h=Date:To:From:Subject:From; b=3r8haXRpAJ1ua3ZmU8gzoegrPnPM6MSXmV+iKEKsuKFNJD4cdXl2SZ94aT1nSGpT7 IHK3/Vhzy2X/dbQhCi6dt0QYaO8EQVa8gf1AlBZJ4rqA0fEj4oIJddQm9dA7lh/4Rr HtmPNs1Kh6CbkE73yPTFtrXv5yW4wGiB9G/th3+tuoqMmLH4ZlQ3QjOs6JBYEhLuMh RqAriD7JqNLp7YtWFOITwEPBBSQDkDu043TVnPBCYBeA1MZz/m8GAjJwOzmzSOtS5O i/cbp/x9CfK4rPGZpw7/AIvz5W8qbVZ8ilIz6Excx1s3gGK/CZV44N2KOfbROSzwh+ JDDTtGsGVgb5w== Date: Wed, 24 Aug 2022 22:51:13 +0200 MIME-Version: 1.0 To: elfutils-devel@sourceware.org Content-Language: en-US From: Nick Subject: elfutils does not compile with gcc 12.2.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: I try to compile elfutils on OpenWrt with the newest gcc 12.2.0 version. However, it fails due to -Werror=use-after-free. A workaround is a patch that I found on the mailinglist, to disable -Werror (https://sourceware.org/legacy-ml/elfutils-devel/imported/msg00994.html) I modified it to apply to newest elfutils version. The error with elfutils 0.187 and gcc 12.2.0: In function 'bigger_buffer',     inlined from '__libdw_gunzip' at gzip.c:376:12: gzip.c:98:9: error: pointer may be used after 'realloc' [-Werror=use-after-free]    98 |     b = realloc (state->buffer, more -= 1024);       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gzip.c:96:13: note: call to 'realloc' here    96 |   char *b = realloc (state->buffer, more);       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Can you apply the patch to disable werror? Or is it necessary to use some "#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wuse-after-free""-statement? Bests Nick