From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id C30973858D39 for ; Wed, 8 Feb 2023 19:52:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C30973858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 318Jm96V015362; Wed, 8 Feb 2023 19:52:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=oXDtSD4zhN/8ks/1ziNkjkENriUOOVOzU2Fcx0os+nM=; b=Qoyo4eYLEFqrOSzh9vDrce0CTfVloQ3LJzoheGAvh0i/aTrUCfdZ/xEfRxejus6bqR7V x63Zu5hKCBv57CXySSN5kb41sp3r5WIeyuzTpQg675U7tv80J5dIW8jwdz5XoI1SmmZ8 McHir/xDBTDThTQG6PIt/ssnvTKAaOg05+K+wOKfab31Fc8zLw+YV/G8Wppjglvd5pS5 wZvTwZEnNWUWMuZQWoR6i8XaNxwEvatGByjyXjH+h+G3hLnV/NHWILcrTDYtD67w/bwN yFC2E2oyCpvlJoUJPDbXHDK2ZJFHMZVp98UUu9eJcov41HJtSkr5Zl7zOekA6qMMW+kq Bw== Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nmj7a827b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 19:52:36 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3183i5hF022813; Wed, 8 Feb 2023 19:52:35 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3nhemfksma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 08 Feb 2023 19:52:35 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 318JqVRU21103146 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 8 Feb 2023 19:52:31 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5B23D20049; Wed, 8 Feb 2023 19:52:31 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15A7E20043; Wed, 8 Feb 2023 19:52:31 +0000 (GMT) Received: from heavy.ibmuc.com (unknown [9.179.24.149]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 8 Feb 2023 19:52:30 +0000 (GMT) From: Ilya Leoshkevich To: Mark Wielaard Cc: elfutils-devel@sourceware.org, Ilya Leoshkevich Subject: [PATCH v2 2/7] printversion: Fix unused variable Date: Wed, 8 Feb 2023 20:52:21 +0100 Message-Id: <20230208195226.144143-3-iii@linux.ibm.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230208195226.144143-1-iii@linux.ibm.com> References: <20230208195226.144143-1-iii@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: FCEzTwXxdt2lqY6UL29IaaQnwhEwAD4- X-Proofpoint-ORIG-GUID: FCEzTwXxdt2lqY6UL29IaaQnwhEwAD4- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-08_09,2023-02-08_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 lowpriorityscore=0 clxscore=1015 malwarescore=0 bulkscore=0 spamscore=0 adultscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302080167 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: clang complains: debuginfod.cxx:354:1: error: unused variable 'apba__' [-Werror,-Wunused-const-variable] ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT; ^ ../lib/printversion.h:47:21: note: expanded from macro 'ARGP_PROGRAM_BUG_ADDRESS_DEF' const char *const apba__ __asm ("argp_program_bug_address") ^ This is as expected: it's used by argp via the "argp_program_bug_address" name, which is not visible on the C level. Add __attribute__ ((used)) to make sure that the compiler emits it. While at it, fix debuginfod not printing the bug report address. Signed-off-by: Ilya Leoshkevich --- lib/printversion.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/printversion.h b/lib/printversion.h index a9e059ff..37adff7e 100644 --- a/lib/printversion.h +++ b/lib/printversion.h @@ -39,11 +39,14 @@ void print_version (FILE *stream, struct argp_state *state); argp_program_bug_address, in all programs. argp.h declares these variables as non-const (which is correct in general). But we can do better, it is not going to change. So we want to move them into - the .rodata section. Define macros to do the trick. */ + the .rodata section. Define macros to do the trick. The default + linkage for consts in C++ is internal, so declare them extern. */ #define ARGP_PROGRAM_VERSION_HOOK_DEF \ void (*const apvh) (FILE *, struct argp_state *) \ __asm ("argp_program_version_hook") #define ARGP_PROGRAM_BUG_ADDRESS_DEF \ - const char *const apba__ __asm ("argp_program_bug_address") + extern const char *const apba__; \ + const char *const apba__ __asm ("argp_program_bug_address") \ + __attribute__ ((used)) #endif // PRINTVERSION_H -- 2.39.1