From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x735.google.com (mail-qk1-x735.google.com [IPv6:2607:f8b0:4864:20::735]) by sourceware.org (Postfix) with ESMTPS id BEC283858D1E for ; Thu, 21 Apr 2022 02:48:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BEC283858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=Damon-Family.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qk1-x735.google.com with SMTP id c1so2669865qkf.13 for ; Wed, 20 Apr 2022 19:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=RRRrRKEdm/9Q6G0/S87aZ8Zwa3kY21t5HTVJfzxWT/I=; b=kPMDLPFBggNOTZ/OQudLX/bLHeMPeOIWLzi0zJOqFG4ljABHk2a31kjCn19aobNyFg asU8+vHEOpY3FUJgdLL+x/c1Upf4SiIEp6dl41ir3Gk5N/vC4MGvK8vjIhlBfgdIRtSx 12sLPFlmSq0wLUKLAsMUGA1GgiCf3e+VfiwJF+qVdHl1jynOZBnmpG/pIsq2NcijMwv2 LtxL/qq/MtnEK2gXmB524XVndA54C0OnO36S3xna1kCsVJBShmyN7woW5q49MfQWsVkH D7NQEyUP7qBxxEDSH/e/ghYlv2qpZceSctWoeJuwAqpORSbIA5E4rWxraB4bjFRqHWX3 aqfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=RRRrRKEdm/9Q6G0/S87aZ8Zwa3kY21t5HTVJfzxWT/I=; b=6+13GLjWg8dgsRcf9KYgtBHfQ+xowrwpxARB7dleEg1R1pXXshg+VpMpGt4qMTLpWr 97CntiLlZEyl9oJBguglwnbuGuvSDF2BXQXVp6GSnBTTON9zzdQFTQFivKOQYuBVAQo8 zZwFdvuxUIIWGvvYKPB2R3FVUmt25AbXQ0RMLEh8mthdTWm1fQfvd7v3h4/SCmYKzjeb J5ihPgcV8kq1uyyYa4NtVbHBuSZnCz0SveZHxGnToHMBdjN3SAuEBEWDnUOw9+au0r1y x7nnKC5A+BYuod84XKw3v+fI+orNjh4BEggB2WHPRVxNHntIGKzOMb6qfsxaSYKaBj36 SgEA== X-Gm-Message-State: AOAM532VEMGnKUCGqMeEb0mMI+jZTbXN+o9bV/G5k82zC+ooGPKdCEYe ZQAfqVqtnD6BAb1ifVl8OybJVuuoF2jTuYkcp5A= X-Google-Smtp-Source: ABdhPJz9yN4Rbt5+IWqcsZUuKBOdUbz7A1tp8wZSvAKGjWBmsdfnbnYA9py2v014zzTVkqMpCihD2A== X-Received: by 2002:a37:5582:0:b0:69e:88dc:79a1 with SMTP id j124-20020a375582000000b0069e88dc79a1mr12785827qkb.661.1650509306738; Wed, 20 Apr 2022 19:48:26 -0700 (PDT) Received: from [192.168.4.21] (pool-108-20-19-251.bstnma.fios.verizon.net. [108.20.19.251]) by smtp.googlemail.com with ESMTPSA id x14-20020a05622a000e00b002f204bf4efdsm2746137qtw.70.2022.04.20.19.48.25 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 Apr 2022 19:48:25 -0700 (PDT) Sender: Richard Damon Message-ID: Date: Wed, 20 Apr 2022 22:48:24 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: Fw: Issue: headers may use non-reserved identifiers Content-Language: en-US To: newlib@sourceware.org References: From: Richard Damon In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, 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: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2022 02:48:29 -0000 On 4/20/22 6:11 PM, C Howland wrote: >> ------------------------------ >> *From:* Newlib on behalf of Pavel M >> *Sent:* Wednesday, April 20, 2022 4:35 PM >> *To:* newlib@sourceware.org >> *Subject:* Issue: headers may use non-reserved identifiers >> >> >> Hi all, >> >> Issue: headers may use non-reserved identifiers. >> >> Example: >> #define _reent 0 >> #include >> >> $ gcc t567.c -std=c11 >> t567.c:1:16: error: expected ‘{’ before numeric constant >> 1 | #define _reent 0 >> | ^ >> t567.c:1:16: error: expected ‘{’ before numeric constant >> 1 | #define _reent 0 >> | ^ >> and so on... >> >> Per C11 _reent, _on_exit_args, etc. are non-reserved identifiers. >> >> Consider fixing. >> >> P.S. Good if it leads to compile time errors, not good if it doesn't (wrong >> translation unit produced => wrong code generated => wrong runtime >> behavior). >> >> -- >> Pavel >> ------------------------------ >> > > No, the headers do not use non-reserved identifiers. Look at the standard > again, as the second dash item in section 7.1.3 Reserved Identifiers > reserves all identifiers that start with underscore. The example program > violates the standard. In short, user programs may not use identifiers > that start with underscore. (More precisely there are some very-limited > cases in which they can, but preprocessor identifiers is not one of them.) Slight correction, identifies that begin with an underscore and followed by a lowercase letter or a number are reserved only at 'file scope' level, so user programs CAN use them as local variable names inside some scope (at least those that don't match the previous cluase of an underscore followed by an uppercase letter or another underscore as those are reserved in all conditions). Now, in the example, the user program used it for a preprocessor symbol which conflicts with the reservation for that identifier for the implementations use. -- Richard Damon