From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id 9A611386074B for ; Thu, 7 Dec 2023 12:25:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9A611386074B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=CeBiTec.Uni-Bielefeld.DE ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9A611386074B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701951947; cv=none; b=JKLudmfwztlEQ3MiwgQHcy1gdWrr6AGdmjyyDAfpLzxtOr+svp3qGJq/rY+nyl11V3hjrWYObolCq7i0I2c1/SlAWv/4zJTTtMEedWZfzF1j+dpPsx/0uQt2wbiEDCLenj7vSOv7+dObBh7/bPuGyARWK/7tkxS6vaNW1seauKE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701951947; c=relaxed/simple; bh=ZneGvUM+Cyo8+D+P7O8IUUAekLLXtPnlaHMPdv+TTdc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nohVm2JR1FvaAz8mhkUFTkXgcXlh49LInKIucREaSPAxh1trGHyaNf7aoeq62umUHdmBIYrRkXBjEjqW4e0kw3x4SrvpgkwYFOK4GuTi7/NOKEtB2cdERwm4SN6hIxOQoWEYDkJD8tlDgzvu/PEG/zn4b5LvyP4eJWwI8l6k17s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 76064B99C9; Thu, 7 Dec 2023 13:25:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:in-reply-to:date:date :references:subject:subject:from:from:received:received :received; s=20200306; t=1701951944; bh=ZneGvUM+Cyo8+D+P7O8IUUAe kLLXtPnlaHMPdv+TTdc=; b=V/9YPOzj67ng6U8z31ref2bvxvU6r96b+qqT2ga8 xypnuhiq77eni1yTLPpEEwr1DjkHPsIEIhUF+64ZjgA6gNCklaWvhUdfTOIeAw19 MAGeTl5kiDT0zneqoOVVi+IY6c6e4JvRkzJYQXm+lsqsmYhpywuqqpZ52l32seYf PskhtLqKuUy/44BWGZIZ6fcbrMlKKQxT5XmWnN2NO1ZT+eXBoSmu7f639yRbcgLo CUAZHmoSTyLT1r+gDrx34EZUNr7SaeMsphMi0ODvBfF3VaJqDfwh3tp2o3c3Gqlj RZEZdVgXh13mTDF2y0muLyyNaLPqlZy2MR9/SpmBAvhbhg== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id PWsD0yEuzGwZ; Thu, 7 Dec 2023 13:25:44 +0100 (CET) Received: from itzacchiuatl.CeBiTec.Uni-Bielefeld.DE (itzacchiuatl.CeBiTec.Uni-Bielefeld.DE [129.70.161.157]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 03442B95E9; Thu, 7 Dec 2023 13:25:44 +0100 (CET) Received: (from ro@localhost) by itzacchiuatl.CeBiTec.Uni-Bielefeld.DE (8.17.2+Sun/8.17.2/Submit) id 3B7CPhon005369; Thu, 7 Dec 2023 13:25:43 +0100 (CET) X-Authentication-Warning: itzacchiuatl.CeBiTec.Uni-Bielefeld.DE: ro set sender to ro@CeBiTec.Uni-Bielefeld.DE using -f From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Richard Biener Subject: Re: [PATCH] libssp: Fix gets-chk.c compilation on Solaris References: Date: Thu, 07 Dec 2023 13:25:43 +0100 In-Reply-To: (Rainer Orth's message of "Mon, 04 Dec 2023 11:42:09 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-3633.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: Rainer Orth writes: > The recent warning patches broke the libssp build on Solaris: > > /vol/gcc/src/hg/master/local/libssp/gets-chk.c: In function '__gets_chk': > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: implicit > declaration of function 'gets'; did you mean 'getw'? > [-Wimplicit-function-declaration] > 67 | return gets (s); > | ^~~~ > | getw > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:67:12: error: returning > 'int' from a function with return type 'char *' makes pointer from integer > without a cast [-Wint-conversion] > 67 | return gets (s); > | ^~~~~~~~ > /vol/gcc/src/hg/master/local/libssp/gets-chk.c:74:12: error: returning > 'int' from a function with return type 'char *' makes pointer from integer > without a cast [-Wint-conversion] > 74 | return gets (s); > | ^~~~~~~~ > > The guard around the gets declaration in gets-chk.c is > > #if !(!defined __USE_ISOC11 \ > || (defined __cplusplus && __cplusplus <= 201103L)) > extern char *gets (char *); > #endif > > __USE_ISOC11 is a glibc-only thing, while Solaris > declares gets like > > #if __STDC_VERSION__ < 201112L && __cplusplus < 201402L > extern char *gets(char *) __ATTR_DEPRECATED; > #endif > > If one needs to check __USE_ISO11 at all, one certainly needs to check > __STDC_VERSION__ to avoid breaking every non-glibc target. Besides, I > don't see what's the use of checking __cplusplus when compiling a C-only > source file. On top of all that, the double negation makes the guard > unnecessarily hard to understand. > > I really don't know if it's useful/appropriate to check __USE_ISOC11 and > __cplusplus here at all; still I've left both for now. > > Here's what I've used to complete the Solaris bootstrap. > > Tested on i386-pc-solaris2.11, sparc-sun-solaris2.11, > x86_64-pc-linux-gnu, and x86_64-apple-darwin23.1.0. Ping? It's only been four days, but without a fix Solaris bootstrap remains broken. In hindsight, I wonder if it wouldn't be better to just check for a gets declaration using AC_CHECK_DECLS, rather than second-guessing what guards various implementions use, even messing with implementation-private macros... Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University