Neither private.h nor zic.c now need a disclaimer regarding a Certain Trademarked Term; removals are attached (and appear in tab-mangled form below). --ado *** /tmp/,aprivate.h 2014-06-25 18:56:51.027685900 -0400 --- /tmp/,bprivate.h 2014-06-25 18:56:51.099690100 -0400 *************** *** 403,410 **** #define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */ #endif /* !defined SECSPERREPEAT_BITS */ - /* - ** UNIX was a registered trademark of The Open Group in 2003. - */ - #endif /* !defined PRIVATE_H */ --- 403,406 ---- *** /tmp/,azic.c 2014-06-25 18:57:00.521228900 -0400 --- /tmp/,bzic.c 2014-06-25 18:57:00.641235800 -0400 *************** *** 2838,2844 **** free(name); return 0; } - - /* - ** UNIX was a registered trademark of The Open Group in 2003. - */ --- 2838,2840 ----
On Jun 25, 11:15pm, eggert@cs.ucla.edu (Paul Eggert) wrote: -- Subject: Re: [tz] disclaimer removals | Thanks, I pushed that into github. Please fix it so that it does not pass char into the isfoo() functions since they have undefined results for negative values other than -1. http://pubs.opengroup.org/onlinepubs/009695399/functions/isalnum.html An easy fix is to cast the value to unsigned char. christos
On 2014/06/26 01:51 PM, Christos Zoulas wrote:
On Jun 25, 11:15pm, eggert@cs.ucla.edu (Paul Eggert) wrote: -- Subject: Re: [tz] disclaimer removals
| Thanks, I pushed that into github.
Please fix it so that it does not pass char into the isfoo() functions since they have undefined results for negative values other than -1.
http://pubs.opengroup.org/onlinepubs/009695399/functions/isalnum.html
An easy fix is to cast the value to unsigned char.
I believe you replied to the wrong thread, but isascii() should be defined for all integer values: http://pubs.opengroup.org/onlinepubs/009695399/functions/isascii.html and the code only calls isalnum() if isascii() returns a non-zero value. -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
Ian Abbott said:
Please fix it so that it does not pass char into the isfoo() functions since they have undefined results for negative values other than -1.
http://pubs.opengroup.org/onlinepubs/009695399/functions/isalnum.html
An easy fix is to cast the value to unsigned char.
I believe you replied to the wrong thread, but isascii() should be defined for all integer values:
http://pubs.opengroup.org/onlinepubs/009695399/functions/isascii.html
and the code only calls isalnum() if isascii() returns a non-zero value.
isascii isn't part of the C Standard. It is better to follow C, which says that the argument to all the is* functions should be an unsigned char or EOF (which is what getc() and friends return). -- Clive D.W. Feather | If you lie to the compiler, Email: clive@davros.org | it will get its revenge. Web: http://www.davros.org | - Henry Spencer Mobile: +44 7973 377646
"Clive D.W. Feather" <clive@davros.org> writes:
isascii isn't part of the C Standard. It is better to follow C, which says that the argument to all the is* functions should be an unsigned char or EOF (which is what getc() and friends return).
It says that only about the functions that the C Standard defines. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."
On 2014/06/26 05:05 PM, Andreas Schwab wrote:
"Clive D.W. Feather" <clive@davros.org> writes:
isascii isn't part of the C Standard. It is better to follow C, which says that the argument to all the is* functions should be an unsigned char or EOF (which is what getc() and friends return).
It says that only about the functions that the C Standard defines.
zic.c will define isascii (as a function-like macro) if it doesn't exist. Unfortunately, it defines it like this: #ifndef isascii #define isascii(x) 1 #endif which is pretty useless. This would be more useful: #define isascii(x) (!((x) & ~0x7f)) or possibly: #define isascii(x) ((unsigned char)(x) < 128) -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
On 2014/06/26 05:56 PM, Ian Abbott wrote:
On 2014/06/26 05:05 PM, Andreas Schwab wrote:
"Clive D.W. Feather" <clive@davros.org> writes:
isascii isn't part of the C Standard. It is better to follow C, which says that the argument to all the is* functions should be an unsigned char or EOF (which is what getc() and friends return).
It says that only about the functions that the C Standard defines.
zic.c will define isascii (as a function-like macro) if it doesn't exist. Unfortunately, it defines it like this:
#ifndef isascii #define isascii(x) 1 #endif
which is pretty useless. This would be more useful:
#define isascii(x) (!((x) & ~0x7f))
or possibly:
#define isascii(x) ((unsigned char)(x) < 128)
Scrub that last possible definition with the cast to (unsigned char). It was a bit of a braino on my part as it doesn't work for all int values as isascii is supposed to. -- -=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
On Jun 26, 3:53pm, abbotti@mev.co.uk (Ian Abbott) wrote: -- Subject: Re: [tz] disclaimer removals | I believe you replied to the wrong thread, but isascii() should be | defined for all integer values: | | http://pubs.opengroup.org/onlinepubs/009695399/functions/isascii.html | | and the code only calls isalnum() if isascii() returns a non-zero value. While this is true, you still get a warning that claims that your array is indexed by a char value on implementations with inline isfoo() functions that reference a _ctype_ array. So it is always good to fix it. christos
Christos Zoulas wrote:
Please fix it so that it does not pass char into the isfoo() functions
The code doesn't pass char into the isfoo() functions. But your message and its followups suggest that the code is overly confusing (especially the bit about isascii, which nowadays never tests whether its argument is ASCII!). And there is one real bug in this area: the code uses predicates like isalpha whose behavior can depend on the locale if HAVE_GETTEXT is true, and that dependency was not intended. I installed the attached patch to try to fix these problems. The basic idea was to discard <ctype.h> as being more trouble than it's worth. A nice little byproduct of this is that we no longer need to worry about ctype.h defining a macro 'isleap' that's incompatible with ours, something POSIX says it's entitled to do.
participants (6)
-
Andreas Schwab -
Arthur David Olson -
christos@zoulas.com -
Clive D.W. Feather -
Ian Abbott -
Paul Eggert