From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 0654E3858D3C for ; Fri, 7 Oct 2022 08:24:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0654E3858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E939D21901; Fri, 7 Oct 2022 08:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1665131057; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nCmT621s8McJ1smEwrvnWlPWKGhlU+8eBizR3SYsVAQ=; b=SDqip+hhpJqfj0y5OQN93A8ccrjEw4H7sWeAF/AwU8zDN5aarstJz5ZSZnFSpPsbJ5C9VU gSrwNdOGrdxYjt/BjCN/MQjQ7lzMmc5XY/CAuhqtS/miDCHNCyu102vqPyVbv3TDZkrZo2 /eEHDIHzDViy8y7CEkPlwUmEt5qEAFU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1665131057; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nCmT621s8McJ1smEwrvnWlPWKGhlU+8eBizR3SYsVAQ=; b=3ugapNYrwqW8snVuq2Y7ASwjZBRLECQqYr4DPuwBnDoUl27XDdYo9OwuhNveJoA9IYXWsP RyjPgV50vDLqs6Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C761513A9A; Fri, 7 Oct 2022 08:24:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id uLgxLzHiP2PEdAAAMHmgww (envelope-from ); Fri, 07 Oct 2022 08:24:17 +0000 Message-ID: <4971570f-8bfa-e1d2-626e-41f9c7784708@suse.cz> Date: Fri, 7 Oct 2022 10:24:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Subject: [PATCH][pushed] fix clang warnings To: gcc-patches@gcc.gnu.org Content-Language: en-US Cc: Jonathan Wakely Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_SOFTFAIL,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: Consulted with Jonathan, I'm going to push that. Martin Fixes: gcc/c-family/name-hint.h:109:66: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call] gcc/config/i386/i386-expand.cc:1351:9: warning: argument 'operands' of type 'rtx[3]' (aka 'rtx_def *[3]') with mismatched bound [-Warray-parameter] gcc/config/i386/i386.cc:15635:8: warning: argument 'operands' of type 'rtx[2]' (aka 'rtx_def *[2]') with mismatched bound [-Warray-parameter] gcc/cp/module.cc:17482:51: warning: argument 'counts' of type 'unsigned int[8]' with mismatched bound [-Warray-parameter] gcc/cp/module.cc:17508:37: warning: argument 'counts' of type 'unsigned int[8]' with mismatched bound [-Warray-parameter] gcc/cp/name-lookup.cc:6385:16: warning: unqualified call to 'std::move' [-Wunqualified-std-cast-call] gcc/c-family/ChangeLog: * name-hint.h: Use std::move. gcc/ChangeLog: * config/i386/i386-protos.h (ix86_binary_operator_ok): Add array size to function parameter. (ix86_unary_operator_ok): Likewise. gcc/cp/ChangeLog: * module.cc (enum module_state_counts): Use array size. * name-lookup.cc (class namespace_limit_reached): Likewise. (class module_state): Move up in the file. --- gcc/c-family/name-hint.h | 2 +- gcc/config/i386/i386-protos.h | 4 ++-- gcc/cp/module.cc | 32 ++++++++++++++++---------------- gcc/cp/name-lookup.cc | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gcc/c-family/name-hint.h b/gcc/c-family/name-hint.h index df733e7e65d..98392ce51c2 100644 --- a/gcc/c-family/name-hint.h +++ b/gcc/c-family/name-hint.h @@ -106,7 +106,7 @@ public: /* Take ownership of this name_hint's deferred_diagnostic, for use in chaining up deferred diagnostics. */ - std::unique_ptr take_deferred () { return move (m_deferred); } + std::unique_ptr take_deferred () { return std::move (m_deferred); } /* Call this on a name_hint if the corresponding warning was not emitted, in which case we should also not emit the deferred_diagnostic. */ diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h index 3b94efefa65..5318fc7fddf 100644 --- a/gcc/config/i386/i386-protos.h +++ b/gcc/config/i386/i386-protos.h @@ -109,7 +109,7 @@ extern void ix86_expand_binary_operator (enum rtx_code, machine_mode, rtx[]); extern void ix86_expand_vector_logical_operator (enum rtx_code, machine_mode, rtx[]); -extern bool ix86_binary_operator_ok (enum rtx_code, machine_mode, rtx[]); +extern bool ix86_binary_operator_ok (enum rtx_code, machine_mode, rtx[3]); extern bool ix86_avoid_lea_for_add (rtx_insn *, rtx[]); extern bool ix86_use_lea_for_mov (rtx_insn *, rtx[]); extern bool ix86_avoid_lea_for_addr (rtx_insn *, rtx[]); @@ -140,7 +140,7 @@ extern void ix86_split_fp_absneg_operator (enum rtx_code, machine_mode, rtx[]); extern void ix86_expand_copysign (rtx []); extern void ix86_expand_xorsign (rtx []); -extern bool ix86_unary_operator_ok (enum rtx_code, machine_mode, rtx[]); +extern bool ix86_unary_operator_ok (enum rtx_code, machine_mode, rtx[2]); extern bool ix86_match_ccmode (rtx, machine_mode); extern void ix86_expand_branch (enum rtx_code, rtx, rtx, rtx); extern void ix86_expand_setcc (rtx, enum rtx_code, rtx, rtx); diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc index 500ac06563a..c5eff219909 100644 --- a/gcc/cp/module.cc +++ b/gcc/cp/module.cc @@ -3469,6 +3469,20 @@ enum streamed_extensions { SE_BITS = 1 }; +/* Counter indices. */ +enum module_state_counts +{ + MSC_sec_lwm, + MSC_sec_hwm, + MSC_pendings, + MSC_entities, + MSC_namespaces, + MSC_bindings, + MSC_macros, + MSC_inits, + MSC_HWM +}; + /********************************************************************/ struct module_state_config; @@ -3666,8 +3680,8 @@ class GTY((chain_next ("%h.parent"), for_user)) module_state { private: void write_config (elf_out *to, struct module_state_config &, unsigned crc); bool read_config (struct module_state_config &); - static void write_counts (elf_out *to, unsigned [], unsigned *crc_ptr); - bool read_counts (unsigned []); + static void write_counts (elf_out *to, unsigned [MSC_HWM], unsigned *crc_ptr); + bool read_counts (unsigned *); public: void note_cmi_name (); @@ -14541,20 +14555,6 @@ module_state::read_partitions (unsigned count) return true; } -/* Counter indices. */ -enum module_state_counts -{ - MSC_sec_lwm, - MSC_sec_hwm, - MSC_pendings, - MSC_entities, - MSC_namespaces, - MSC_bindings, - MSC_macros, - MSC_inits, - MSC_HWM -}; - /* Data for config reading and writing. */ struct module_state_config { const char *dialect_str; diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index d6757d1fe5d..25657cfd4c6 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -6382,7 +6382,7 @@ class namespace_limit_reached : public deferred_diagnostic std::unique_ptr wrapped) : deferred_diagnostic (loc), m_limit (limit), m_name (name), - m_wrapped (move (wrapped)) + m_wrapped (std::move (wrapped)) { } -- 2.37.3