public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@twinsun.com>
To: rms@gnu.org
Cc: zack@rabi.columbia.edu, bothner@cygnus.com, amylaar@cygnus.co.uk,
	martin@mira.isdn.cs.tu-berlin.de, gcc2@gnu.org, egcs@cygnus.com
Subject: Re: revised proposal for GCC and non-Ascii source files
Date: Thu, 31 Dec 1998 15:55:00 -0000	[thread overview]
Message-ID: <199812312353.PAA16596@shade.twinsun.com> (raw)
In-Reply-To: <199812301324.IAA11023@psilocin.gnu.org>

   Date: Wed, 30 Dec 1998 08:24:40 -0500
   From: Richard Stallman <rms@gnu.org>

   Your proposal seems pretty good, but it's missing one very important
   feature.  That is the warning if the locale has an effect on the
   result and was not explicitly specified....

   Solution A: use #charset rather than #pragma charset....
   We could simply forbid this usage and say that #charset must be used
   at the beginning of the file only.  Nothing but whitespace (including
   comments) should be allowed preceding #charset.

Thanks for reminding me about the diagnostic, and your solution about
#charset sounds reasonable.  I'll include the following new text in
the next version of the proposal.  It has a couple of extra ideas:

* There are some restrictions on the comments that can precede the
  `#ctype' directive.  They have to be valid GNUC comments, and thus
  cannot use arbitrary characters from the desired charset.

* If you want to disable the warnings, you can do so with an explicit
  `-ctype ""' option or with an explicit `#ctype ""' directive; this
  gets the ctype from the environment without any warnings.

----------

 1. Determining the input ctype.

    The input character type FOO can be specified by the new `-ctype
    FOO' compile-time option or the new `#ctype "FOO"' directive.  GCC
    processes this option by invoking the functions setlocale
    (LC_CTYPE, "FOO") and nl_langinfo (CODESET), and reports an error
    if these two functions do not both succeed.  If "FOO" is the empty
    string, this procedure obtains the ctype from the locale in the
    usual way; this disables the warnings specified in (11).

    The default ctype is determined from the locale, which
    is specified in the usual way with the LC_ALL, LC_CTYPE, and LANG
    environment variables; if the environment variables are not set,
    or if the setlocale and nl_langinfo functions do not both succeed,
    the default ctype is GNUC.

    The `#ctype "FOO"' directive must be at the start of its source
    file, preceded only by white space and comments that are valid
    when interpreted with the GNUC ctype.  In practice, it's safe to
    put non-GNUC encodings into // comments before the #ctype
    directive, but /* comments are not safe, because some multibyte
    encodings use `*' and `/' bytes.

    ...

11. If no -ctype option or #ctype directive is specified, and GCC's
    behavior differs from what it would have been with the GNUC ctype,
    then GCC issues a warning.

  reply	other threads:[~1998-12-31 15:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-28 17:59 Paul Eggert
1998-12-29  1:38 ` Martin von Loewis
1998-12-29  1:39 ` Martin von Loewis
1998-12-29  5:53   ` Paul Eggert
1998-12-29  6:22     ` Martin von Loewis
1998-12-31 13:55       ` Paul Eggert
1999-01-31 23:58         ` Martin v. Loewis
1999-01-31 23:58           ` Paul Eggert
1999-01-31 23:58           ` Per Bothner
1999-01-31 23:58             ` Joe Buck
1999-01-31 23:58               ` Jeffrey A Law
1999-01-31 23:58         ` Zack Weinberg
1999-01-31 23:58           ` Paul Eggert
1999-01-31 23:58           ` Horst von Brand
1999-01-31 23:58             ` Paul Eggert
1999-01-31 23:58               ` Horst von Brand
1999-01-31 23:58                 ` Paul Eggert
1999-01-31 23:58                   ` Horst von Brand
1999-01-31 23:58                     ` Martin v. Loewis
1999-01-31 23:58                 ` Martin v. Loewis
1999-01-31 23:58           ` Martin v. Loewis
1999-01-31 23:58             ` Zack Weinberg
1999-01-31 23:58               ` Martin v. Loewis
1999-01-31 23:58               ` Paul Eggert
1998-12-29  1:50 ` Martin von Loewis
1998-12-29  5:41   ` Paul Eggert
1998-12-30  5:21 ` Richard Stallman
1998-12-31 15:55   ` Paul Eggert [this message]
1998-12-30 14:58 ` Zack Weinberg
1998-12-31 14:28   ` Paul Eggert
1998-12-31 15:13   ` problems with C9x's _Pragma Paul Eggert

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=199812312353.PAA16596@shade.twinsun.com \
    --to=eggert@twinsun.com \
    --cc=amylaar@cygnus.co.uk \
    --cc=bothner@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=gcc2@gnu.org \
    --cc=martin@mira.isdn.cs.tu-berlin.de \
    --cc=rms@gnu.org \
    --cc=zack@rabi.columbia.edu \
    /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).