From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 488BD3858C52 for ; Thu, 10 Nov 2022 18:43:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 488BD3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668105806; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=pRp4ielw7Wv2mt+Pei3vm9cMK65RrZQbQppsPM1PiKQ=; b=clDghcvIkNkIDru0SdI72RH4Dl/dvdBu+fW97ylAyZM3blRoDrylnva/eqWrJ6ryraSV/f DAHjWXIy7TgZvwCj/Cm3XCZfKJpEvjLKH3vHRdCkdhPx/gnmAj4wsN1hTlWftsSxCtx6aw Uku5w1DXtTHM+Eg4YqOW5cExgy9Sx00= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-203-cAPTdQ6gPEap35uUqrycHg-1; Thu, 10 Nov 2022 13:43:25 -0500 X-MC-Unique: cAPTdQ6gPEap35uUqrycHg-1 Received: by mail-qv1-f72.google.com with SMTP id ln3-20020a0562145a8300b004b8c29a7d50so2097425qvb.15 for ; Thu, 10 Nov 2022 10:43:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pRp4ielw7Wv2mt+Pei3vm9cMK65RrZQbQppsPM1PiKQ=; b=VZd/2lYSKot5pr/tXh7t4e8BG0Ks0J+p7xOfz2S0tQohDbcl2zqZHaSOvH1flhj4Ue 5T4Ycf7CjzcBvoyhjolIcEG0QPCKFhR0+J2zhSpeqSql4pFrMK7LHOIwMBw4dScfkfKO TuGEpIwXEmwzy42P405CWlEH64VVMB7IeNw/bwLIFUcj04cG+02/cu7M8xq2vsJDCgR6 INx6ZhfytNjR/nwr7HcSpzpKc9IDjZVUXJjeloQDXm/+zQc4aAjoHeMlqIhB+U5dFc+q oRT/FEiKHo/IjQFsi7fdW8WCRvG43rpTu/JHXQWaJCQ13cfaX9CwNW75Lm4uD+dZhpl0 IoNQ== X-Gm-Message-State: ACrzQf0cKHT4F2ZxEKbgfGEFPaZKmibmAOq63mjiYparn+9sYYMksDcy Iw+iDFp7ydhdHUJx5iAW4Xj2CvGPLfFdBMtRxWoAsO3P0xKoeXPlSzZ6WR3+uZhnpFmcghq/F1q 4yP3IZDM= X-Received: by 2002:a05:6214:d01:b0:4bb:b4f9:cb8b with SMTP id 1-20020a0562140d0100b004bbb4f9cb8bmr59240855qvh.9.1668105804927; Thu, 10 Nov 2022 10:43:24 -0800 (PST) X-Google-Smtp-Source: AMsMyM76PFvEAYNYWfPVU7c3JxE2llKwsIz2O2joXUL5xagxcIXZ/W3BSU1w9oGnBMuaG+Lzur695w== X-Received: by 2002:a05:6214:d01:b0:4bb:b4f9:cb8b with SMTP id 1-20020a0562140d0100b004bbb4f9cb8bmr59240850qvh.9.1668105804743; Thu, 10 Nov 2022 10:43:24 -0800 (PST) Received: from redhat.com (2603-7000-9500-2e39-0000-0000-0000-1db4.res6.spectrum.com. [2603:7000:9500:2e39::1db4]) by smtp.gmail.com with ESMTPSA id s10-20020a05620a16aa00b006fa31bf2f3dsm36656qkj.47.2022.11.10.10.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 10:43:23 -0800 (PST) Date: Thu, 10 Nov 2022 13:43:22 -0500 From: Marek Polacek To: Florian Weimer Cc: gcc@gcc.gnu.org Subject: Re: -Wint-conversion, -Wincompatible-pointer-types, -Wpointer-sign: Are they hiding constraint C violations? Message-ID: References: <87mt8ysm3y.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 In-Reply-To: <87mt8ysm3y.fsf@oldenburg.str.redhat.com> User-Agent: Mutt/2.2.7 (2022-08-07) X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Nov 10, 2022 at 07:25:21PM +0100, Florian Weimer via Gcc wrote: > GCC accepts various conversions between pointers and ints and different > types of pointers by default, issuing a warning. > > I've been reading the (hopefully) relevant partso f the C99 standard, > and it seems to me that C implementations are actually required to > diagnose errors in these cases because they are constraint violations: > the types are not compatible. It doesn't need to be a hard error, a warning is a diagnostic message, which is enough to diagnose a violation of any syntax rule or constraint. IIRC, the only case where the compiler _must_ emit a hard error is for #error. > Is this interpretation correct? > > Sorry if this questions this is more appropriate for the gcc-help list. > > Thanks, > Florian > Marek