From: Andreas Schwab <schwab@linux-m68k.org>
To: Andrea Monaco via Gcc <gcc@gcc.gnu.org>
Cc: Andrea Monaco <andrea.monaco@autistici.org>
Subject: Re: No type checking in ctype builtins
Date: Wed, 27 Apr 2022 17:54:33 +0200 [thread overview]
Message-ID: <87mtg65xom.fsf@igel.home> (raw)
In-Reply-To: <87sfpy1r5s.fsf@autistici.org> (Andrea Monaco via Gcc's message of "Wed, 27 Apr 2022 17:29:03 +0200")
On Apr 27 2022, Andrea Monaco via Gcc wrote:
> This program
>
> #include <ctype.h>
>
> int main ()
> {
> char *s;
> isspace (s);
> }
>
> compiles with no warning in gcc 8.3.0, even though there's a type
> mistake; the correct call would be isspace (*s).
Try -Wsystem-headers.
> The ctype functions are implemented as macros in glibc, so you can't
> have type checking. But they are also provided as builtins by gcc, so I
> wonder why type checking is not performed in that case, either.
You need to suppress the macro to get the builtin.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."
next prev parent reply other threads:[~2022-04-27 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 15:29 Andrea Monaco
2022-04-27 15:54 ` Andreas Schwab [this message]
2022-04-27 18:07 ` Andrea Monaco
2022-04-28 11:13 ` Florian Weimer
2022-04-27 16:19 ` Jonathan Wakely
2022-04-28 12:02 ` Eric Gallager
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=87mtg65xom.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=andrea.monaco@autistici.org \
--cc=gcc@gcc.gnu.org \
/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).