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.133.124]) by sourceware.org (Postfix) with ESMTPS id EE66B384DED1 for ; Thu, 15 Feb 2024 16:45:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EE66B384DED1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EE66B384DED1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708015507; cv=none; b=HCTqXCB2C7HpMbLuiqiCoh8N27B5uF2/8nGwYDssuHCwjv47NvsSjkeQxOWsxxQnizmfB6xlaongdazzzSRpibLVkIWJcWGea1yhZEbUTicEsR8oQb2gb/AD/y+1+ZC8aSrYVIznGV2143RRggGE9msGmQK3op5d2vyr0pBLhK8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708015507; c=relaxed/simple; bh=SgHwO4+fRaJuQ9WwszoSeAwyrggp0DQHs1LaOCRoRWc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EnUx9jqvFZyVnQTwWc8Utii9YQxtOW7QbU6c0mT9pdI2pYY3peAzFjVxPvNQLUIZdY3vjZhzt25mvD/e+kCMdsei/s2CZo9YPhBKKJNKMzP7Kx50M+zuZW6AR+66qgy3MIAyroM/+SmxVUrkQD+1bEIvprjQxAzAno8YhVMRsT8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708015504; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9ScB/bOAuofXnGYfT8lTYzGwQmQtybPd0f3QSt8hp/k=; b=YtcF1y3de4lz9HJbORkqncE1BVCrnR9xtfLuCZlbQPp4AlZBft+e+UIAejiRneMkIxmsxt tJ/l/LfHVlbK3SbCvQ7Nmjyi/gE1wBG4Ck9eQnncqS41DtdoqsIc1GaRneHO1m9zP7C5pl wcnCeNXuguFLkJsDVBFMdbDZCEac2GI= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-522-EJXoRBZ6NU2lrqxcJ-An7A-1; Thu, 15 Feb 2024 11:45:03 -0500 X-MC-Unique: EJXoRBZ6NU2lrqxcJ-An7A-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B96C329AC03C; Thu, 15 Feb 2024 16:45:02 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.50]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF262492BE7; Thu, 15 Feb 2024 16:45:01 +0000 (UTC) From: Florian Weimer To: Gerald Pfeifer Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Notes on the warnings-as-errors change in GCC 14 References: <87v876ssxg.fsf@oldenburg.str.redhat.com> <2058c7ba-20af-7cb5-f15d-ec0653f76903@pfeifer.com> Date: Thu, 15 Feb 2024 17:44:59 +0100 In-Reply-To: <2058c7ba-20af-7cb5-f15d-ec0653f76903@pfeifer.com> (Gerald Pfeifer's message of "Sat, 10 Feb 2024 12:00:34 +0100 (CET)") Message-ID: <875xypad84.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: * Gerald Pfeifer: > On Fri, 2 Feb 2024, Florian Weimer wrote: >> htdocs/gcc-14/porting_to.html | 465 +++++++++++++++++++++++++++++++++++= +++++++ >> 1 file changed, 465 insertions(+) >> + >> +

Using pointers as integers and vice versa (-Werror=3Dint-conversion)

> >> +It makes sense to address missing int type, implicit > > Should this be plural here ("int types") or some adding a=20 > word such as "declaration"? Genuine question. =E2=80=9Cmissing int type[s]=E2=80=9D seems to be okay. >> +Some of them will be caused by missing types resulting >> +in int, and the default int return type of >> +implicitly declared functions. > > ...resulting in implicit int... or something like that? > Not sure how to be phrase it. I went with: =E2=80=9Cmissing types [treated as] int=E2=80=9D >> +GCC no longer casts all pointer types to all other pointer types. > > Do you mean it no longer does so implicitly, or not at all? That is, > there are now cases where even an explicit cast such as > > foo_p =3D (foo_type*) bar_p > > no longer works? Or just > > foo_p =3D bar_p > > no longer works for all combinations? The latter, other reviewers noted it as well, and I've got this now: =E2=80=9CGCC no longer [allows implicitly casting] all pointer types to all= =E2=80=9D >> +appropriate casts, and maybe consider using code void * >> +in more places (particularly for old programs that predate the >> +introduction of void into the C language). > > Here I got confused. > > At first I thought I was reading that void * should be used= =20 > for cases where void did not exist yet. Now I think I=20 > understand: this is about programs where void * was not used= =20 > since it was not part of the language yet - and the encouragement is to= =20 > update such old code by using it.=20 > > If so, how about making the second case void *, too? Makes sense. Technically you can't have void * without void, but I can see this may be confusing. >> +#include <stddef.h> > > I *think* we may need to use > here instead of plain '>', though I may= =20 > be wrong. No, only < needs to be quoted. This is true even for XML, not just HTML5. Do you want me to change these to >? >> +
>> +int
>> +compare (const void *a1, const void *b1)
>> +{
>> +  char *const *a =3D a1;
>> +  char *const *b =3D b1;
>> +  return strcmp (*a, *b);
>> +}
>> +
> > Great that you include this example here, that really helps! > > Just why "const void *a1" versus "char *const *a", that is, the different= =20 > placement of const? It's the right type. 8-) The examples uses an array of char *, not const char *. >> +unrelated to the actual objective of the probe. These failed probes >> +tend to consistently disable program features and their tests, which >> +means that an unexpected probe failure may result in silently dropping >> +features. > > Omit "consistently"? I'm not sure what it adds here. And simplify the=20 > second half, something like > > These failed probes tend to disable program features (and their tests),= =20 > resulting in silently dropping features. What about this? These failed probes tend to disable program features [together with] their tests[], resulting in silently dropping features. This what I meant with =E2=80=9Cconsistently=E2=80=9D: implementations and = tests are gone, so the testsuite doesn't flag it. >> +In cases where this is a concern, generated config.log, >> +config.h and other source code files can be compared >> +using diff, >> +to ensure there are no unexpected differences. > > I wouldn't link to GNU diffutils here; just refer to the diff=20 > command - or even omit that aspect and leave it at "can be compared". diff is really useful for that, manual comparison isn't. 8-) I can drop the hyperlink. >> +Some build systems do not pass the CFLAGS environment >> +or make variable to all parts of the builds > > Is "make" a common variable? What is the context here? Hmm, I meant to allude $(CFLAGS) here. =E2=80=9CCFLAGS [] variable to all parts of the builds=E2=80= =9D should be sufficient. >> +

>> +It is unclear at which point GCC can enable the C23 bool >> +keyword by default (making the bool type available >> +without including #include <stdbool.h> explicitly). > > Does C every include some header files implicitly? GCC does, for . Not relevant here, though. > For the benefit of the doubt: Okay, and thank you, modulo feedback from= =20 > Jonathan and my two responses. Thank you for your review. I need to add two more code examples to the Autoconf section, should I post a v2 with that, or add that in a subsequent commit? Florian