bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/3] yacc: compute the best type for the state number


From: Kaz Kylheku
Subject: Re: [PATCH 0/3] yacc: compute the best type for the state number
Date: Wed, 02 Oct 2019 10:55:31 -0700
User-agent: Roundcube Webmail/0.9.2

On 2019-10-01 22:27, Akim Demaille wrote:
Apparently like Kaz, I like to name my types *_t, so I'd be happy with
yy_state_t (scalars) and yy_state_least_t/yy_small_state_t (arrays)

The claiming of _t by POSIX is largely bunk.

Here is one counterargument:

1. Every finite string has the empty string as a suffix.

2. All current and foreseeable future POSIX and ISO C identifiers
   are finite; thus they have the empty string as a suffix.

3. Therefore, to avoid clashes, don't use identifiers that have an
   empty string suffix claimed by POSIX! Use only infinitely long
   identifiers.

Over time, POSIX has invented new identifiers that didn't follow
any namespace pattern. Or they suddenly invented new namespace
prefixes, unpredictably. We've survived.

We also have feature selection macros. If some new_fangled_t
is introduced into <sys/types.h> in 2050, there will be some
-DPOSIX_SOURCE=20500112 or whatever to enable its visibility,
and that of any function prototypes which use it.

(given that here, we're kind of protected by yy_*: POSIX/ISO etc.
would be really bad people to start using them.)

POSIX people *are* using them; yacc is specified in POSIX!

"Conforming applications shall not use names beginning in yy or YY since the yacc parser uses such names."

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/yacc.html

You better know this! :)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]