Re: Default signedness of 'plain' char.

Liste des GroupesRevenir à cl c 
Sujet : Re: Default signedness of 'plain' char.
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.lang.c
Date : 04. Aug 2026, 22:25:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <114tlkt$2g79h$1@dont-email.me>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 8/4/2026 1:10 PM, Waldek Hebisch wrote:
Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
On Mon, 03 Aug 2026 14:47:21 +0000, Lew Pitcher wrote:
>
On Sun, 02 Aug 2026 14:17:45 +0000, Kenny McCormack wrote:
>
First off, I know the "standards" answer is "Either is correct; you have no
right to complain about anything", but I am not interested in the
"standards" answer.  If this is all you can do, then just click Next and go
on.
>
I'm interested in the "why" of why implementations might prefer one or the
other.
>
Consider the effects of the integer promotion rules on a system with an 8-bit
execution characterset (CHAR_BIT == 8) that has significant characters in the
0x80 through 0xff range[1], and how it affects the return results of functions
like getchar(), getc(), and fgetc().
[snip]
[1] Not as hypothetical as you might think; Some of the earliest C compilers
(and current compilers as well) targetted the IBM EBCDIC systems, where much
of the basic execution characterset resides between 0x80 and 0xff, with the
numeric characters residing between 0xf0 and 0xf9. A signed <<char>> would
not work here.
>
For what it's worth, this was also the reason (prior to Unicode) that C
did not specify that alphabetic characters would have a contiguous sequence
in the execution characterset. In EBCDIC, the alphabetics group a-i, j-r, s-z
and A-I, J-R, S-Z, with various other characters (both assigned and unassigned)
between the groupings.
 Unless you are payed specifically to do so I see no reason to support
EBCDIC.  Of course, IBM have enough influence to keep C standard
as it is regarding character set, but it does not mean that anybody
else should take is seriously.
 
Practically speaking, unless one is targeting a machine that uses EBCDIC or some other nonstandard character set, better advised to mostly ignore it, as ASCII has made a decisive win here...
Well, and UTF-8...
Had in my projects partly adopted Unicode, but not without fudging.
Basic character-set mostly limited to a few blocks:
Latin-1 range;
Also went and added Greek and Cyrillic characters and similar.
Except 0600..07FF: Reclaimed / Reused in 8x8 console fonts.
   Most characters in this range can't be represented in 8x8 pixels.
   Was more useful to use 0600..06FF for 00..FF dense hexadecimal.
     0..9, A..F: Can be represented nicely in 4x8 pixels.
In some cases, it is nice to be able to display twice the hexadecimal in half the space (can also be used for decimal by treating it as BCD).
Also for reasons was nicer if it could fit in the UTF-8 2-byte range.
In this case, 0700..07FF can be used for some patterns related to UI drawing and representing images via color-cells.
Say, for example (6 bits):
   Vsgn,Hsgn,Vfrq2,Hfrq2
Which effectively specifies a sine-wave pattern at 1 of 4 frequencies with a sign; Both horizontal and vertical.
This can be used to generate a series of 64 patterns that are useful in approximating images as color-cells.
Well, then some rounded curves and dithered gradient patterns (for more useful image approximation); and some basic tilesets for UI elements.
Well, some of these can be useful if one is storing graphics data in a form like, say:
   1b: Escape (0=Normal, 1=Skip/RLE/etc)
   7b: Cell-Index
   4b: ColorA, 16-color / RGBI
   4b: ColorB: 16-color / RGBI
     Skip might be used for blocks that are skipped over;
     RLE for blocks repeating the same pattern or a flat-color region.
     ...
Though, not exactly high fidelity; but when it works OK, may be hard to beat (and can reuse text-console mechanics).
...

Date Sujet#  Auteur
2 Aug 26 * Default signedness of 'plain' char.85Kenny McCormack
3 Aug 26 +* Re: Default signedness of 'plain' char.8Kenny McCormack
3 Aug 26 i+* Re: Default signedness of 'plain' char.2bart
3 Aug 26 ii`- Re: The Spanish Inquisition1bart
4 Aug13:13 i`* Re: Default signedness of 'plain' char.5Theo
5 Aug08:30 i `* Re: Default signedness of 'plain' char.4Lawrence D’Oliveiro
5 Aug17:20 i  `* Re: Default signedness of 'plain' char.3bart
5 Aug22:57 i   +- Re: Default signedness of 'plain' char.1Lawrence D’Oliveiro
5 Aug23:29 i   `- Re: Default signedness of 'plain' char.1Keith Thompson
3 Aug 26 +* Re: Default signedness of 'plain' char.2David Brown
3 Aug 26 i`- Re: Default signedness of 'plain' char.1BGB
3 Aug 26 +- Re: Default signedness of 'plain' char.1Waldek Hebisch
3 Aug 26 +- Re: Default signedness of 'plain' char.1Dan Cross
3 Aug 26 +* Re: Default signedness of 'plain' char.13Lew Pitcher
3 Aug 26 i`* Re: Default signedness of 'plain' char.12Lew Pitcher
4 Aug 26 i +* Re: Default signedness of 'plain' char.4Keith Thompson
4 Aug16:10 i i`* Re: Default signedness of 'plain' char.3Lew Pitcher
5 Aug04:00 i i +- Re: Default signedness of 'plain' char.1Lawrence D’Oliveiro
5 Aug08:01 i i `- Re: Default signedness of 'plain' char.1David Brown
4 Aug19:10 i `* Re: Default signedness of 'plain' char.7Waldek Hebisch
4 Aug22:25 i  +- Re: Default signedness of 'plain' char.1BGB
5 Aug03:57 i  +* Re: Default signedness of 'plain' char.3Lawrence D’Oliveiro
5 Aug06:19 i  i`* Re: Default signedness of 'plain' char.2Lynn McGuire
5 Aug23:38 i  i `- Re: Default signedness of 'plain' char.1Dan Cross
5 Aug05:36 i  `* Re: Default signedness of 'plain' char.2Keith Thompson
6 Aug01:21 i   `- Re: Default signedness of 'plain' char.1Waldek Hebisch
3 Aug 26 +* Re: Default signedness of 'plain' char.39Chris M. Thomasson
3 Aug 26 i+* Re: Default signedness of 'plain' char.37bart
3 Aug 26 ii`* Re: Default signedness of 'plain' char.36Chris M. Thomasson
4 Aug 26 ii `* Re: Default signedness of 'plain' char.35BGB
4 Aug 26 ii  +* Re: Default signedness of 'plain' char.2Chris M. Thomasson
5 Aug10:40 ii  i`- Re: Default signedness of 'plain' char.1BGB
5 Aug08:22 ii  `* Re: Default signedness of 'plain' char.32Lawrence D’Oliveiro
5 Aug10:02 ii   +* Re: Default signedness of 'plain' char.9BGB
5 Aug11:35 ii   i+- Re: Default signedness of 'plain' char.1David Brown
5 Aug20:39 ii   i+* Re: Default signedness of 'plain' char.3Chris M. Thomasson
6 Aug15:05 ii   ii`* Re: Dear Chris2bart
6 Aug19:10 ii   ii `- Re: Dear Chris1David Brown
5 Aug22:54 ii   i`* Re: Default signedness of 'plain' char.4Lawrence D’Oliveiro
6 Aug10:49 ii   i `* Re: Default signedness of 'plain' char.3BGB
7 Aug01:10 ii   i  `* Re: Default signedness of 'plain' char.2Lawrence D’Oliveiro
7 Aug08:56 ii   i   `- Re: Default signedness of 'plain' char.1David Brown
5 Aug18:33 ii   +* Re: Default signedness of 'plain' char.21James Kuyper
5 Aug22:50 ii   i`* Re: Default signedness of 'plain' char.20Lawrence D’Oliveiro
6 Aug09:34 ii   i `* Re: Default signedness of 'plain' char.19David Brown
9 Aug21:19 ii   i  `* Re: Default signedness of 'plain' char.18BGB
9 Aug21:33 ii   i   +* Re: Default signedness of 'plain' char.4Lawrence D’Oliveiro
10 Aug02:04 ii   i   i`* Re: Default signedness of 'plain' char.3Chris M. Thomasson
10 Aug03:45 ii   i   i `* Re: Default signedness of 'plain' char.2Lawrence D’Oliveiro
10 Aug10:24 ii   i   i  `- Re: Default signedness of 'plain' char.1Chris M. Thomasson
10 Aug02:03 ii   i   +* Re: Default signedness of 'plain' char.12Chris M. Thomasson
10 Aug07:58 ii   i   i`* Re: Default signedness of 'plain' char.11David Brown
10 Aug21:17 ii   i   i `* Re: Default signedness of 'plain' char.10BGB
10 Aug23:19 ii   i   i  +* Re: Default signedness of 'plain' char.6Keith Thompson
10 Aug23:31 ii   i   i  i`* Re: Default signedness of 'plain' char.5BGB
11 Aug00:48 ii   i   i  i +- Re: Default signedness of 'plain' char.1Lawrence D’Oliveiro
11 Aug01:03 ii   i   i  i +* Re: Default signedness of 'plain' char.2James Kuyper
11 Aug02:44 ii   i   i  i i`- Re: Default signedness of 'plain' char.1BGB
11 Aug07:58 ii   i   i  i `- Re: Default signedness of 'plain' char.1David Brown
11 Aug01:29 ii   i   i  +- Re: Default signedness of 'plain' char.1steve g
11 Aug04:58 ii   i   i  +- Re: Vectors! Quaternions! (was Re: Default signedness of 'plain' char.)1Lawrence D’Oliveiro
11 Aug08:06 ii   i   i  `- Re: Default signedness of 'plain' char.1David Brown
11 Aug05:52 ii   i   `- Re: Default signedness of 'plain' char.1Lawrence D’Oliveiro
5 Aug20:36 ii   `- Re: Default signedness of 'plain' char.1Chris M. Thomasson
5 Aug08:18 i`- Re: Default signedness of 'plain' char.1Lawrence D’Oliveiro
6 Aug00:30 `* Re: Default signedness of 'plain' char.20Lynn McGuire
6 Aug00:41  +* Re: Default signedness of 'plain' char.18Keith Thompson
6 Aug01:24  i+* Re: Default signedness of 'plain' char.14bart
6 Aug01:46  ii+- Re: Default signedness of 'plain' char.1Keith Thompson
6 Aug23:59  ii`* Re: Default signedness of 'plain' char.12Dan Cross
7 Aug03:54  ii `* Re: Default signedness of 'plain' char.11Keith Thompson
7 Aug12:02  ii  `* Re: Default signedness of 'plain' char.10Dan Cross
7 Aug18:35  ii   +* Re: Default signedness of 'plain' char.3Keith Thompson
7 Aug19:32  ii   i`* Re: Default signedness of 'plain' char.2Dan Cross
7 Aug19:55  ii   i `- Re: Default signedness of 'plain' char.1Janis Papanagnou
7 Aug19:51  ii   `* Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)6Janis Papanagnou
7 Aug21:03  ii    `* Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)5Keith Thompson
7 Aug21:32  ii     +- Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)1Keith Thompson
7 Aug22:44  ii     +- Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)1Dan Cross
7 Aug22:47  ii     `* Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)2Janis Papanagnou
7 Aug23:26  ii      `- Re: Use of isascii() back in early days (was Re: Default signedness of 'plain' char.)1Keith Thompson
6 Aug23:57  i`* Re: Default signedness of 'plain' char.3Dan Cross
7 Aug02:23  i `* Re: Default signedness of 'plain' char.2Keith Thompson
7 Aug12:47  i  `- Re: Default signedness of 'plain' char.1Dan Cross
6 Aug23:33  `- Re: Default signedness of 'plain' char.1Keith Thompson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal