From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 986233858C54 for ; Fri, 12 May 2023 17:55:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 986233858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-96a5903758fso507938266b.1 for ; Fri, 12 May 2023 10:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683914153; x=1686506153; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=gm8C11kMw2kqXmCF/CU+XiFMcFmS39eBirMGZI/W4T4=; b=YGwZnr8eHrjYO+c+eyeTrTrpsqjUaZ5D+cb5pV2b3OFJVITAB7N+PuhgZy97/G3NuM o8wk80w6O90CNCkjB/NCTwqKajLGI7wjIB0HGFO1TI918Foi6w1KqbSh/aMCW33A9Ufu dc7oqiS8YvNW+f6MuQDksqqzF5yomf0ZTajbjbJjd+RCyusULmicpx9kX1VMG6kg+WO0 OhYLO6DM6URCPKLVMiTQuxfxSszkViHSb/dm99mM2AfxbeVQYDUAG3UUUBvS0/iNEQH3 JoGFcLartMcxQ0K0xIkqwyWEdPWYp55dxx5OH9Lv/hMiNmQchS97s3NjCymyjAMKacX7 XHdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683914153; x=1686506153; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=gm8C11kMw2kqXmCF/CU+XiFMcFmS39eBirMGZI/W4T4=; b=jU6Hnz/8nxaMz/SRydfshGoBy/nLke2/eCtiA0csDmq6y8yOmwqDZ21yJzi2vJ3izT p1G0uTxyfpOtMN/6G6d91m9F+dxZya4cWgzfE4H2O+VFRpUoih4LYvqTbczDHitXZ5zI 7dLdZ/ciA1bGGBsFsY/c+daT7qcEvQMRiG5n6mZZiBI+vApvIlG75tVnXr9owO2KPomc TpjZmk4VIGsk4L7M2Fjo6INek5xqhtGIWSrwLkFh2yE0epPM3fJXsh7xi7u4Aiactb3z QIbYL1zYNP1gmqdnPdlgcrYnqf2gkrQKRfCuOfFgcVa/EEyFX4grgNmlABtCz1CXrAeQ FuFg== X-Gm-Message-State: AC+VfDyrzAL7cmC2cgfL7RFg0/BMS/n5ZDFQ6Wci46gLRyo5sQb/SlBx umXs/+HNDvcbj4hf5IUGtmc= X-Google-Smtp-Source: ACHHUZ5XWL2wJuIe5wqwKUubZHfGDeDmSpvDIKpu3wSoev8pLME+lTYPNyAXIaQQ8WuN+VbW6t3wdQ== X-Received: by 2002:a17:907:c22:b0:961:2956:2ed9 with SMTP id ga34-20020a1709070c2200b0096129562ed9mr28968703ejc.25.1683914152899; Fri, 12 May 2023 10:55:52 -0700 (PDT) Received: from [10.31.0.11] ([194.126.177.88]) by smtp.gmail.com with ESMTPSA id ml23-20020a170906cc1700b0094ea3a32694sm5699927ejb.190.2023.05.12.10.55.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 May 2023 10:55:52 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------u5OPWj1KMkA0SiI70XNeY0aW" Message-ID: <3d157d9c-0504-b8b4-46f6-54ea90374765@gmail.com> Date: Fri, 12 May 2023 19:55:51 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: More C type errors by default for GCC 14 Content-Language: en-US To: Florian Weimer , Joseph Myers Cc: Eli Zaretskii , Jakub Jelinek , jwakely.gcc@gmail.com, fweimer@redhat.com, gcc@gcc.gnu.org, arsen@aarsen.me References: <87y1lx1avj.fsf@oldenburg.str.redhat.com> <83ednoapb6.fsf@gnu.org> <831qjoa0g0.fsf@gnu.org> <83o7ms8is7.fsf@gnu.org> <2ffbf210-1b58-737b-888c-4f84c5cc5e0f@gmail.com> <837ctg8e98.fsf@gnu.org> <83wn1g6w67.fsf@gnu.org> <83mt2c6tch.fsf@gnu.org> <871qjlh9t3.fsf@mid.deneb.enyo.de> <87jzxdfne0.fsf@mid.deneb.enyo.de> From: Gabriel Ravier In-Reply-To: <87jzxdfne0.fsf@mid.deneb.enyo.de> X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: This is a multi-part message in MIME format. --------------u5OPWj1KMkA0SiI70XNeY0aW Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/12/23 19:52, Florian Weimer wrote: > * Florian Weimer: > >> In summary, all these seems to be good candidates for errors by default: >> >> * int-conversion as errors (already raised separately >> * -Wint-conversion for ?: >> * parameter names in non-prototype function declarations >> * the union wait function pointer compatibility kludge >> * return-with-out-value for non-void functions >> * -Wincomatible-pointer-types warning for ?: (but no error yet, see below) > I think we have another problem. > > We do not warn by default for: > > int x; > unsigned *p; > > p = &x; > > Isn't that a conformance issue because the pointers are incompatible, > requiring a diagnostic? > > Furthermore, Unlike the char case, this tends to introduce > strict-aliasing violations, so there is a good reason to treat this > variant as an error (even if we would only warn for char * and > unsigned char *). Isn't this allowed by the standard ? 6.5.7. Expressions states: > An object shall have its stored value accessed only by an lvalue expression that has one of thefollowing types:[...] - a type that is the signed or unsigned type corresponding to the effective type of the object --------------u5OPWj1KMkA0SiI70XNeY0aW--