Re: [hatari-devel] Warnings |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
- To: hatari-devel@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [hatari-devel] Warnings
- From: Vincent Rivière <vincent.riviere@xxxxxxxxxxx>
- Date: Sat, 3 Oct 2020 13:32:17 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:subject:to:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=cNVgZ7xpK9hlzVkCM8LZY86N3qp4AUyMzJL+nIWtaOE=; b=GIJoxJKR4/UygoNrVHx80MuZ3E8naqDtjg44oROa2rDbVNeTgDQWgZmF9LVDTi88Ig lELPWiUtVSxsSQclGJS1FCTeGOsq18obTJMhQCA/xSSiYP9SxX/LNFArhkPTQIVzxKLK rlboNmQMk87io9o/fLc0FMbsbXpdFgH+jVMnJl5gW6iwh65GIWfL4K4B37DRN7j6cbIu dB41KGIJvjp0anhNlEcJB6azXjw4LW1BxnEm75e/tTvu+EbmCFcUW54deHls4VbhM5ge Isaf/GgkbClElJvZ2T9DUH1c0mOMEKQYVbL53UjUB1mK23gReQaPI5zkmn7qw7npILdb JxVQ==
On 03/10/2020 at 09:55, Thomas Huth wrote:
Oh, Cygwin still has such a crappy implementation of the ctype functions?
How old is your Cygwin installation? Maybe they fixed it in newer
versions?
My Cygwin installation is up-to-date (32-bit variant). Compiler is GCC 10.2.0.
By the way, the official ctype API is messy. Functions take an int as
parameter instead of char, to also allow EOF as parameter, with a value
different from all possible char. So if the parameter is a raw char AND
compiler uses signed char by default AND the value is negative (i.e.
accented characters), we lose.
As I understand, the correct way to call ctype functions is something like:
extern char c;
if (isprint((unsigned int)c)) ...
Assuming that the compiler will not issue a warning because of passing an
unsigned int argument to an int parameter, otherwise we need an extra cast
to int. Situation may even be different if ctype functions are actually
defined as macros.
BTW, I don't really mind about those warnings. I just wanted you to be aware
of them, to avoid potential issues.
--
Vincent Rivière