From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by sourceware.org (Postfix) with ESMTPS id 739083858D39 for ; Tue, 9 Nov 2021 12:35:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 739083858D39 Received: by mail-oi1-x234.google.com with SMTP id m6so7458856oim.2 for ; Tue, 09 Nov 2021 04:35:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=f/93vTuTLW+AjOHHRS0kkR8K6dyhFs0aZdS0VeSuBVA=; b=Ri8NCMQBJyjqBH3VchV/K+NwwSo1gfJj4Q4v5YS5raT62yCeQrrn1XDYd+bnVlqUyp ZmXoiDwxgOp365Nr/JIV+zbPTXI8RO/r62DvfNbAZe+gc6FxgRddAB1daLbn4RRs9o5c gGBe49z4gypO8sCK9qixsyV4EMBeqe1zPoOFkk9Cjs0q8aK0cd10mEik9xSq7zTe5oFd k8CoaslDLlfJXSBW4X/YVooyHTBh9yAR54ZoiwMxa7PSgJNwF1onKB3LEk4JEa9A9XJ1 fiTFpkXKMa1oUfgual4XFyN58XIHFAZI8gVwkK85N7E44XlOWfrwfE55wNT9k0ALCJNg 5/LQ== X-Gm-Message-State: AOAM532PXWNkUgFMP7JLGBhcZIqbbnUmAzlaIgFr38tGLzGi+OHiukiz Is0I2q4NVF4mWP7V3hJmoB3Kmg== X-Google-Smtp-Source: ABdhPJzARXRTlOYi2y2pjfK1qcQKvX97QSZzwdOxaJ1mFblbGXI9VX2deBwxBsO6I6XtykoQkT+xtQ== X-Received: by 2002:a05:6808:1914:: with SMTP id bf20mr3145379oib.149.1636461328872; Tue, 09 Nov 2021 04:35:28 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:55a:469b:f306:bf3e:39da? ([2804:431:c7cb:55a:469b:f306:bf3e:39da]) by smtp.gmail.com with ESMTPSA id g1sm1823350ots.56.2021.11.09.04.35.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 04:35:28 -0800 (PST) Message-ID: <8ef62689-64fc-1f47-a6b0-6af0c1dca8fe@linaro.org> Date: Tue, 9 Nov 2021 09:35:26 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: strerror_r GNU flavor Content-Language: en-US To: Jonny Grant , GNU C Library References: From: Adhemerval Zanella In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 12:35:31 -0000 On 09/11/2021 07:33, Jonny Grant wrote: > Hello > > Is it better to depreciate the GNU flavor of strerror_r now that there is a POSIX version? > > I was reading "string.h" and the man page: > > https://man7.org/linux/man-pages/man3/strerror.3.html > > The man page does state :- > > "The XSI-compliant strerror_r() is preferred for portable > applications. It returns the error string in the user-supplied > buffer buf of length buflen." > > Keeping the GNU version sounds reasonable, but at least marking it depreciated? The main problem is the GNU version is the one exported with _GNU_SOURCE. It means to favor the XPG would require to export it as _GNU_SOURCE, which leads to more potential breakage (since for programs that use _GNU_SOURCE is likely to be troublesome to disable it). This is not a worthwhile change and is definitely an *API* break. > > Some other queries :- > I noticed this page does not include the POSIX version of strerror_r > > https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html Usually the manual favor on GNU extension, but I don't think this prevent us to document POSIX functions as well. > > Also, this page function definition says "size_t n" instead of the expected "size_t buflen", should that be changed? The variable name is meaningless in this context. > > char * strerror_r (int errnum, char *buf, size_t n) > > Cheers > Jonny >