From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8EB0F1396D9 for ; Fri, 10 Nov 2017 20:09:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F41D0E0F1C; Fri, 10 Nov 2017 20:09:45 +0000 (UTC) Received: from mail-ot0-x233.google.com (mail-ot0-x233.google.com [IPv6:2607:f8b0:4003:c0f::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 9A238E0E3A for ; Fri, 10 Nov 2017 20:09:45 +0000 (UTC) Received: by mail-ot0-x233.google.com with SMTP id s88so9138262ota.4 for ; Fri, 10 Nov 2017 12:09:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=BupJUu37J0cXAESQMDA5do8guxl0dqZo9esIXPXJTa0=; b=V4yOgeWtxT7MGw9pdvneb0HaNMIEz3PQUQFEzbPcB/S+L9hassgzZ6BTYSX35FMwNK pkPbG4v9LKxL3l5uDF8hT+7JX5fbvy/nIQJmUrTYzlAUxggXwbe0mfBKx4n/dJ38nJ2t 9VGZ0X6Xd67tUtFU5yAXesYydUKVelDxrmRkYm8pQV9PkSzOjzzCdAzg6eIEwaKcmX+g Fp+OYiFUJipJJubGkc6y+8SERKmluMKLgLBpce516Ql8VYcJF6w5OAGK8XRV32Zt7+Kp xfbCrN8hNgZg7mn5HOy7sU1FUUkyOhjNtirO+MfguCikAui/xF7V9srKuvKNyfsvTEx3 Jv/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=BupJUu37J0cXAESQMDA5do8guxl0dqZo9esIXPXJTa0=; b=DC2jdzPzqVxxiASiVUiIiiGA9EANEQpoUPAKRvl2+omd5RE7r22W2dSF3vLoLk8mPH CZRfziOXyQPGdBjVCBDwTo2uYdnxNmFZ9NRQFYP0Bm81RXTxZkhtamnDAUwyWJAtL1gj BSVarnWwenduk61iJHFezxVg09kvfCnEQwlPoGueBsATPASwBK2DCC4cYaQtAbQ7HLX4 2KMkwdUf2/LXi72/dBZkVL8KNHb7DBkBHujoBDy+aHB+XQkaVKSM4aXAMpYsAvIop7aj RR+sWYkelgl5yEQjKCi5ntHsUmwzINbz4SGwGcw/sMPadKShaxuyJBSB8xtJALDlq535 aY7Q== X-Gm-Message-State: AJaThX7gAAGBLE1QH+AybOLq7rwlLa7nvC647+FVBwwn7pxwBdmKbb58 3fNafIu0X15gPzsyWansmu2u18VWglxEzTMb71gNGQ== X-Google-Smtp-Source: AGs4zMboOYCWI1fcMa67e+J1B2Pw302MRwSfiQWLjxR2xLotjSGdzQ6ZSFBBGazsWQrxMJh8jWzTEP7yFldlWmR5WK8= X-Received: by 10.157.74.130 with SMTP id i2mr1063767otf.149.1510344584505; Fri, 10 Nov 2017 12:09:44 -0800 (PST) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.157.83.24 with HTTP; Fri, 10 Nov 2017 12:09:24 -0800 (PST) In-Reply-To: References: <26501197.ioODuGg76y@thetick> From: Jorge Almeida Date: Fri, 10 Nov 2017 20:09:24 +0000 Message-ID: Subject: Re: [gentoo-user] memset_s To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset="UTF-8" X-Archives-Salt: f8800563-c7a5-484a-b5e6-bdceeef5bd19 X-Archives-Hash: 1de9e79ad3413b932e87f81c881d36e4 On Fri, Nov 10, 2017 at 4:25 PM, R0b0t1 wrote: > Hello, > > > I'm having trouble finding the article again, but these functions look > very similar to Microsoft's extensions to the C standard. There is a > good case to be made that they are counterproductive. Yes, it looks like it. No wonder, if it's MS inspired. But what I care about is the fact that it's not optimized away, not the boundaries checking stuff. It's hard to believe that it is practically impossible to clean up a buffer, unless one is willing to forego all optimizations: http://www.daemonology.net/blog/2014-09-04-how-to-zero-a-buffer.html >> Of course, what would really solve the optimize-into-oblivion problem >> is a pragma that when invoked on a particular block of code (maybe >> only a function definition) would tell the compiler to do what the >> programmer says rather than viewing a function as a kind of black box. >> > > This would probably be useful. It may be wise to reimplement important > functionality. > No idea how difficult it would be to implement, of course. There might even exist a C keyword for that. After all, the C standard states the "as-if" rule, it might as well establish such an exception. Cheers Jorge