public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: C Howland <cc1964t@gmail.com>
To: newlib@sourceware.org
Subject: Re: Fw: Issue: headers may use non-reserved identifiers
Date: Wed, 20 Apr 2022 18:11:13 -0400	[thread overview]
Message-ID: <CANk6obSsuUUAyiv7d5bpOmEyF=qbaKUQp+xYpU_53QogRdnzSw@mail.gmail.com> (raw)
In-Reply-To: <BN2P110MB1544D7B44A9377983D6ADC2C9AF59@BN2P110MB1544.NAMP110.PROD.OUTLOOK.COM>

> ------------------------------
> *From:* Newlib on behalf of Pavel M <pavel.morozkin@gmail.com>
> *Sent:* Wednesday, April 20, 2022 4:35 PM
> *To:* newlib@sourceware.org <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 <stdio.h>
>
> $ 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.)

  parent reply	other threads:[~2022-04-20 22:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 20:35 Pavel M
     [not found] ` <BN2P110MB1544D7B44A9377983D6ADC2C9AF59@BN2P110MB1544.NAMP110.PROD.OUTLOOK.COM>
2022-04-20 22:11   ` C Howland [this message]
2022-04-21  2:48     ` Fw: " Richard Damon
2022-04-21  4:56       ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANk6obSsuUUAyiv7d5bpOmEyF=qbaKUQp+xYpU_53QogRdnzSw@mail.gmail.com' \
    --to=cc1964t@gmail.com \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).