From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2d.google.com (mail-oa1-x2d.google.com [IPv6:2001:4860:4864:20::2d]) by sourceware.org (Postfix) with ESMTPS id 0C9B63858C78 for ; Tue, 11 Apr 2023 13:39:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0C9B63858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-18447b9a633so7061930fac.7 for ; Tue, 11 Apr 2023 06:39:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1681220349; x=1683812349; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=hkJRTfnPartZekBO7cRpKDSHZqlfx5YBg3lon40P9Ro=; b=uZdBMCIwcj6OoBUsKWul6Db4JbMazlypxkhDxLkggTAXoZryKvWb+p9DaevPTxUbvy 3eLtuylGuZZUp6OGN+xVuX7aK+aNv+nyozxqPfhy2iv0B1BL6lkr7f/t/FC35/n0UMQn OSidPZclQ1DDAPUARUrbkJgQvi9r5fnaDgZs+fgA2mizIqx7jZRn9yTdZ+0R042DteOI 1oEqgrkOYy2Y8KHv9nH0VqOWdO5zgjDJhqWKSLE0DSo84iDAan3sjS4D+/ZHy/98IZPQ Fx2PvkOBmnQAkaW8+Vm93MXIafFd0XKqaIvA/SIExEkX8vcTYjzDodn+dCay3HrQY8Qp dfSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681220349; x=1683812349; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hkJRTfnPartZekBO7cRpKDSHZqlfx5YBg3lon40P9Ro=; b=v1UBXKNpPtsbWK28oln27HIaaTOVsCwaQ9bOmvr2AD6J32iwBaTXpJXhBMvbD5smYt 9LCze0a1BQ2Ew89Z/MsJhKC6C6p9BvQX11PXg9aQmBtuZ/wv5xfrTUNMCJWp+bBS6O0G J5BkM49D1vEiRUaFpMaUGdu7+ZI2e/ySLRyn3NksL+IHScsJOlrjoGBEDRkqm9iCvovq o4whzxLAoglKYo5fNoutpTqmmcZ55TSTmgl/iaNvLDW+HNnRIPdc9Wccx1s0ThOKSfro cxK5rT3mv/eOOfo9jifPJwfdZu5otvgRcgWMG8sq3D3dVuVsceJpuJGEgk21YtagQH1s LXMA== X-Gm-Message-State: AAQBX9dSAFLFf1cJOLbRYs4mcytILw6i+OLPIIj0+FR0H9NohPfGrk0A mBkoEkMyrhqtyyX38qhevEDWaQ== X-Google-Smtp-Source: AKy350aQ5DYn50Vn37jxwfifVkKiQG4iLXDRlw2LmR9K4ia5RP5mDHxXM5PWyx67v2fhgYNzoL55Dg== X-Received: by 2002:a05:6870:d0c1:b0:177:b6ce:1e5a with SMTP id k1-20020a056870d0c100b00177b6ce1e5amr8908380oaa.32.1681220349205; Tue, 11 Apr 2023 06:39:09 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:55a1:1474:97d8:bf65:d9d0? ([2804:1b3:a7c2:55a1:1474:97d8:bf65:d9d0]) by smtp.gmail.com with ESMTPSA id s32-20020a05687050e000b001729072f759sm5155733oaf.0.2023.04.11.06.39.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 06:39:08 -0700 (PDT) Message-ID: <0d99df74-fb83-1647-ca19-17d2229f0ae0@linaro.org> Date: Tue, 11 Apr 2023 10:39:05 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: glibc misc/sys/cdefs.h nonull - typo in comment Content-Language: en-US To: Jonny Grant , GNU C Library , Paul Eggert References: <25d0b6fa-7b45-3f8e-946a-ad3256e211a4@jguk.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <25d0b6fa-7b45-3f8e-946a-ad3256e211a4@jguk.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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: On 11/04/23 06:09, Jonny Grant wrote: > Hi > > There are two small changes I suggest if someone has a moment? > > misc/sys/cdefs.h nonull - typo in comment > Should be "nonnull" This is already being fixed by c8ba52ab3350c334d (2.34). > > Also > > /posix/glob.c has an unused macro > # define _GL_ARG_NONNULL(params) > > Could that be removed? This definition is used by gnulib code, since it defined for !_LIBC, Different than glibc, gnulib defines the function as: lib/glob.in.h 103 #if @GNULIB_GLOB@ 104 # if @REPLACE_GLOB@ 105 _GL_FUNCDECL_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags, 106 _gl_glob_errfunc_fn __errfunc, 107 glob_t *_Restrict_ __pglob) 108 _GL_ARG_NONNULL ((1))); 109 _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags, 110 _gl_glob_errfunc_fn __errfunc, 111 glob_t *_Restrict_ __pglob)); 112 # else 113 # if !@HAVE_GLOB@ 114 _GL_FUNCDECL_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags, 115 _gl_glob_errfunc_fn __errfunc, 116 glob_t *_Restrict_ __pglob) 117 _GL_ARG_NONNULL ((1))); 118 # endif 119 _GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags, 120 _gl_glob_errfunc_fn __errfunc, 121 glob_t *_Restrict_ __pglob)); 122 # endif Which then at the implementation is also check for pattern == NULL: lib/glob.c: 316 if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0) 317 { 318 __set_errno (EINVAL); 319 return -1; 320 } So the comment is right that compiler might indeed remove the test. Different than gnulib, glibc prototype does not add the __attribute__ ((nonnul)). > > Seems _GL_ARG_NONNULL is only used in misc/error.c which again just compiles it out. So maybe it can be removed overall in both files? This was added as a sync with gnulib code by 888c679ba40, because it is used in error_tail definition and glibc does not define it. So we can not remove without also adjusting error_tail, and since the code is originally from gnulib maybe it would be better to use __nonnull macro. > > Kind regards > Jonny