From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +KauJa+LnmB98wAAgWs5BA (envelope-from ) for ; Fri, 14 May 2021 16:39:43 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +MREIa+LnmBsIQAAB5/wlQ (envelope-from ) for ; Fri, 14 May 2021 14:39:43 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C24C8219A6 for ; Fri, 14 May 2021 16:39:42 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3ED09271E5; Fri, 14 May 2021 10:39:39 -0400 (EDT) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id B7D4A20017 for ; Fri, 14 May 2021 10:39:35 -0400 (EDT) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 8BE251B00121; Fri, 14 May 2021 17:39:34 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1621003174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bMuh1vlEWzC7b9aYfii6E6mHRLofa/ECtAwUqjtf7SQ=; b=G85TJETiIkD/gKaTai3eP24XcOXDa5tmocJq65ippr1HrSTemByqUMm6++Qzrg3cRsm5Dw V5Rf3lrmd549I6+LTEJs4Cu2OxjyIPo0BlWqHcd5nA5h5gmgdcfMweKaBvyrXnX4Mpy66Q NpFZYb1n7fHqVHRQe+s4mHxD3QJFWAoVAaWeYxjSbKtPV94jvndkm6kEYh/UJeb6OZV+US 5iAtLhgd0uAxMDx/lnfQcdQ4UA8WizbHgZDOTMChtPo73y92lMcnQXyFlPjifRsYmM9AJk hxzZC0d/U6sRDVNvMBO45t6c+uF/BX7DvTG0ZVDwrTk3ITWLvajqOQAiF4gOnw== From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 6/7] CLI: make static message strings const In-Reply-To: <877dk1ehoy.fsf@tethera.net> References: <20210513100710.1460566-1-david@tethera.net> <20210513100710.1460566-7-david@tethera.net> <877dk1ehoy.fsf@tethera.net> User-Agent: Notmuch/0.32+21~gfdddd4c (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1621003174; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bMuh1vlEWzC7b9aYfii6E6mHRLofa/ECtAwUqjtf7SQ=; b=WX3GEruUMCHsdVRK8LXaI0St2fP/0muM5VkU5IA0rd92vUJxL3GfcS8TfTHcftWnPMz8iB VtFFlE/3ExDPK8o9XCwIAeqHSXU3kkIUkr9pt0TU3qv2j7OkIck0A4WojLf/4siXMtBD08 J7j8voqIXiFs1GXukBp6iwEW0sSE//H7ain6khlN5f4Hj90lV8urE7v2R9AylQYr+0+xVy NXypRZETVKIKu+49bdjBv465TzLiX08+e3SOIGZB+mycwsvP4MiLunusI1JqBWqm3swLOJ +3IlEKTtCL4y7NTKUrqEKQ7SZl8bMlr5EcUHI9qbDPyRre3VhEfE8sy2l/wHfw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1621003174; a=rsa-sha256; cv=none; b=bXzv+56zsILIr0Nf6xbFDA1FDEfSJ+4AugMIG+9ffzITqBjq8WUVQ3tqW8/CXW+NlmxBPY hjt0CzAnInTrF9UjD2ZW77wjcmdCVubok4TKiFWBVQbLn2scx4ll7NK6DYCbpiDfkqSJjc pcxQkC2VaL5av7Ld9GpT7wJTD70CqMFPNebGQhPPm+uyUQFFEPqOsQxNo5xH4JuYTD4N3m ved8gGeAbIiKj7UvsteXyIdcKV3fLWF5SH6kHmGDs6tmkNQy4Ilgg77ef3hE+pPWLV3Ah2 pFKazcL4+M6+oRQTPfpGXOa4ZdReACxvjBQ8ir50Kv9dmVVM88Ya7tmZODubxw== Message-ID-Hash: YWWMGCXSGTHRXWXWHXOSMBCR2PSLDSK5 X-Message-ID-Hash: YWWMGCXSGTHRXWXWHXOSMBCR2PSLDSK5 X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1621003183; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=Jv4TMlOaxRkLuy5BpFgtA7JXK76l+MBcky4Fr4ku3t8=; b=SBBqQDsVT67FOvA5tlSQSUoernvYGaF88XTOYkR4FZwyXhJKRcxhK/q4qELLnP5LyzrR4S VmmOg4YnyW1Cioog2Ck+BCbkivfEgKhU7X+fvmQQoar+vPD3oHVlVXUO/Zxm514bSdzjV+ o0wSfCX8ivuBnIfTKuNXkgtSE+C8h35aVyajxLPi+SmAoIoTc+iYZNsbUZfQT2fI9ObFuN Zvy/pz2I9BUs3rtzZvpJD/8Cdzey7EW7naOTAaM45jjFpodDZ1VsvbEpLLcZRI+hLBITZT PEIa5hN/ePdHBd2pakJZk9zM47+f2OyXCeUEVO2RnQN7bWQRXEdgTd83O0wjKg== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1621003183; a=rsa-sha256; cv=fail; b=jsLJ7XeirY0nXKZO8GZUohQ3YOMNxQNmNtNHCdCADuvsvkLZ2Yzfu/btx+meui0I5lxY0n JQo5ANES9x2vWLkGX2JVp/jvkbYlmniF32jR+OOzmDhatSu2BtSdPAH1ci+ZaKMg/B0gcr Vx5UYDJWwBL01O1bfwt43evYfcl5acReH4th7mHzGzHV5plORvA3MEO2i1My5W+5DbpgZt IGn//3Q4y9hJ7Ncl58rW7PEz9IeCb6x7GzDQ7QTLcR8UGrZqrHqVxom3flfgXyBd9Ao6tn DARBc1YPVxab6xeaDyOSHAOlfXDZ/RnFHkAUHvnMUHznZfI8dV5m9E21OiMDYA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=G85TJETi; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 1.09 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=G85TJETi; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C24C8219A6 X-Spam-Score: 1.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: l7mY+IlaJNS3 On Fri, May 14 2021, David Bremner wrote: > Tomi Ollila writes: > >> >> In my projects I've been using the following macro: >> #define WriteCS(fd, str) write((fd), (str), sizeof(str) - 1) >> but I don't know if that behaved any better (if we cared)... > > I'm not sure. The sizeof here is actually slightly treacherous (iiuc, > making things const char * will blow up the world) so I prefer it out in > the open. Right, const char * would make sizeof 8 (or 4). (I just fixed bug somewhere where first 4 chars of strings were compared for equality ;/). The WriteCS meant (Const String), perhaps LS (Literal String) would be better. (and write((fd), "" str "", sizeof(str) - 1)). ... have to check if this works, and start using if it works as expected! Tomi > >> But, in addition to these two identical copies of handle_sigint() >> also notmuch-new.c and notmuch-reindex.c defines anoter 2 identical >> copies of handle_sigint()... >> >> I did not see that those two were also modified in this series... > > Good catch! I did the same for those two and pushed the modified series.