From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by sourceware.org (Postfix) with ESMTPS id 332FE3856DDA for ; Thu, 28 Apr 2022 12:02:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 332FE3856DDA Received: by mail-vs1-xe31.google.com with SMTP id z144so4343730vsz.13 for ; Thu, 28 Apr 2022 05:02:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Na4reTTMNdxTerK/AuvTczUcQakgDoGjBDFCAIFauQ4=; b=GMpRsICQ69DkgEEtlz0P5RuNljA4YyNWAS7bKW/W4Nc0B2zHDtE99SFvaH3tGDqyPN itSPW1KV+YABeeQHP3B+XGQjh3QQgpdTg7JO91L9b4JptncF9PnSxTeEVMV9ucZzbLP9 eVvmRch1AX+ZPYYFIpPOytUwsGyP4n/qfe9hIdY1wLFe9fPrQLXIudUxNh1uerswBQN+ HVEQOz0Tfzu9qK8KIjDNei+dpgiDfof1fTxkRVGWREpRuP3euiYrmbOCM47bTkkM6rCv 1a3N0NbzsIxsqLUXBWxvpVM0l4RyZsKDCY2tkZDb8S0SINAH8aQRTb0qgcm+dG3ZeMF6 koNA== X-Gm-Message-State: AOAM531NlRvOrWGtvBSE4GFm6EwCXFVwvRhZLvWOiz3zOvejFibvn9/J JCvrfLMrs+qAz33qm/SAfE3WaNnSYzBhnZzOAQVDOw== X-Google-Smtp-Source: ABdhPJy7V68n0E2TivQNufOfW6AiRaWEIbSYfHmpmeOd3cmDtUhZNUO3GNxMvAJVHbHLw9Yrr3oAbmZYxQit/k/cpGI= X-Received: by 2002:a05:6102:3139:b0:32a:244e:9a84 with SMTP id f25-20020a056102313900b0032a244e9a84mr10692207vsh.14.1651147359553; Thu, 28 Apr 2022 05:02:39 -0700 (PDT) MIME-Version: 1.0 References: <87sfpy1r5s.fsf@autistici.org> In-Reply-To: From: Eric Gallager Date: Thu, 28 Apr 2022 08:02:28 -0400 Message-ID: Subject: Re: No type checking in ctype builtins To: Jonathan Wakely Cc: Andrea Monaco , "gcc@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 12:02:50 -0000 On Wed, Apr 27, 2022 at 12:20 PM Jonathan Wakely via Gcc wrote: > > On Wed, 27 Apr 2022 at 16:29, Andrea Monaco via Gcc wrote: > > > > > > This program > > > > #include > > > > 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). > > N.B. The correct call would be isspace((unsigned char)*s) because > isspace has undefined behaviour if you pass it a char with a negative > value. > > It would be nice if GCC warned about *that*. Related bugs: 78155: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78155 99950: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99950