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 94479385B504 for ; Wed, 1 Feb 2023 09:48:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 94479385B504 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=1675244911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=6elDABGApEk6TaxRl4QLm8QvpuHhXyqxRwjS/4mTmNg=; b=gIEwos6l8yYuBG0rnolRHX3f+sEDd21ocKa/9+1uVV1qxSZgVPatp37urGK0yMGXbJh9P2 eYw6NUYNoCHJHbXqqtsxIqDJdBb+YBjah0t8b/m4NohFeQqWUtRxeIlWXYkPcCcZhCY+nE Cxjv6Ky4z4XOJHgEzNUc9diJFn40Zjk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-377-jofwEZFGMQmWAd46i5KkYA-1; Wed, 01 Feb 2023 04:48:30 -0500 X-MC-Unique: jofwEZFGMQmWAd46i5KkYA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D67DA85A5A3 for ; Wed, 1 Feb 2023 09:48:29 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.33.36.170]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 89DF81121330 for ; Wed, 1 Feb 2023 09:48:29 +0000 (UTC) From: Nick Clifton To: binutils@sourceware.org Subject: Fix sanitization warning message building gas. Date: Wed, 01 Feb 2023 09:48:28 +0000 Message-ID: <87lelhzpg3.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Hi Guys, I am applying the patch below to fix a couple of compile time warnings when building the assembler with sanitization enabled: gas/dwarf2dbg.c: In function 'size_inc_line_addr': gas/dwarf2dbg.c:1644:18: error: comparison of integer expressions of different signedness: 'addressT' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare] 1644 | if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA) gas/dwarf2dbg.c: In function 'emit_inc_line_addr': gas/dwarf2dbg.c:1726:18: error: comparison of integer expressions of different signedness: 'addressT' {aka 'long unsigned int'} and 'int' [-Werror=sign-compare] 1726 | if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA) Cheers Nick diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index b54050c6442..05f966256e4 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -1641,7 +1641,7 @@ size_inc_line_addr (int line_delta, addressT addr_delta) tmp += DWARF2_LINE_OPCODE_BASE; /* Avoid overflow when addr_delta is large. */ - if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA) + if (addr_delta < 256U + MAX_SPECIAL_ADDR_DELTA) { /* Try using a special opcode. */ opcode = tmp + addr_delta * DWARF2_LINE_RANGE; @@ -1723,7 +1723,7 @@ emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len) tmp += DWARF2_LINE_OPCODE_BASE; /* Avoid overflow when addr_delta is large. */ - if (addr_delta < 256 + MAX_SPECIAL_ADDR_DELTA) + if (addr_delta < 256U + MAX_SPECIAL_ADDR_DELTA) { /* Try using a special opcode. */ opcode = tmp + addr_delta * DWARF2_LINE_RANGE;