public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [RFC] libstdc++: Generate error_constants.h from <errno.h> [PR104883]
Date: Tue, 4 Oct 2022 19:05:21 +0100	[thread overview]
Message-ID: <CACb0b4nsWJXNWhWMQ+W5QT58P4Jc==UQ=ytZCNwVzPf9ymFY4Q@mail.gmail.com> (raw)
In-Reply-To: <20221004165109.559028-1-jwakely@redhat.com>

On Tue, 4 Oct 2022 at 17:51, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Does anybody see any issues with generating the list of error numbers at
> build time?
>
>
> -- >8 --
>
> Instead of having several very similar target-specific headers with
> slightly different sets of enumerators, generate the error_constants.h
> file as part of the build. This ensures that all enumerators are always
> defined, with the value from the corresponding errno macro if present,
> or a libstdc++-specific alternative value.
>
> The libstdc++-specific values will be values greater than the positive
> integer _GLIBCXX_ERRC_ORIGIN, which defaults to 9999 but can be set in
> os_defines.h if a more suitable value exists for the OS (e.g. ELAST
> could be used for BSD targets).
...
> +${CXXCPP} -P -D_POSIX_C_SOURCE=200809L -x c++ "$constants_h" \
> +  | sed -e '1,/^GLIBCXX ERROR CONSTANTS BELOW HERE$/d' \
> +  >> "$output_h" || exit $?

Gah, this is the wrong version of the script! It's supposed to replace
unexpanded EXXX tokens with __LINE__ (which is why #line is used to
set the origin) but I seem to have committed the wrong version.

Let me dig that out of my git reflog ...


  reply	other threads:[~2022-10-04 18:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04 16:51 Jonathan Wakely
2022-10-04 18:05 ` Jonathan Wakely [this message]
2022-10-04 18:30   ` Jonathan Wakely

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='CACb0b4nsWJXNWhWMQ+W5QT58P4Jc==UQ=ytZCNwVzPf9ymFY4Q@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.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).