From patchwork Tue Mar 11 09:34:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 107633 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 22C79385840E for ; Tue, 11 Mar 2025 09:37:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 22C79385840E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=J/SIykFF X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 8131C3858288 for ; Tue, 11 Mar 2025 09:34:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8131C3858288 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 8131C3858288 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741685654; cv=none; b=nADSduOcFiXi9vPg9sdwrkKrBS3v8RqsxZ3UeshY+04vJRVWOzrI8hwoL9QxmqCSzmPczYMEWpessLEDXIOw/qadO4lfjO7wf2H01ZulUg1Vr8/1UuE5hO8xhrcI78ud2RQXV1hNAgj109Qcpb83B/lJ80GvHsyI4zvk1CB+OUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1741685654; c=relaxed/simple; bh=HfSRinMiCk7NgQ3t7PA1UrMo9GfoDUp4s/fkS3yI/Sc=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=CfYY5/2KSbPRaM5RnqqPCVnuhESPGvZ1au7r6PXSBvk3cETEB13vsqQ7q1CFcBU3HiPMKv3OX1WXbLxkcwDy8kmDeXLcf5iW38OdAfdbIKUWcBjKjvSQ67vVYE3OwhhseN6Pf1+0B6L59Te2YAUTQO/Pu8k+vODBABW6ON4DYUI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8131C3858288 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1741685654; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=ZhTIDhZ3+oRcNyG/mZEaCHlFy1Wxl8/1HZKSBYld9Y8=; b=J/SIykFFWqfU70xJouKfkrfn7pF3yQr/FWkr+La8CoHMId27g8qLEPKIObARSfB0TuGzC5 0bSSq5N1FkirpPsAVXP+ZzDHWhVCWzjowYuktdZhNNcniwKdDDGYMogj0oqsAn7OGTfe5Y l82Ksw4Efh0CRPl8jvHG+Pi3ZGu/mQg= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-661-XHH0mTpMMq6Wq2BABkFg1Q-1; Tue, 11 Mar 2025 05:34:10 -0400 X-MC-Unique: XHH0mTpMMq6Wq2BABkFg1Q-1 X-Mimecast-MFC-AGG-ID: XHH0mTpMMq6Wq2BABkFg1Q_1741685650 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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 mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9B6D2180AF4C; Tue, 11 Mar 2025 09:34:09 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.22.89.222]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0714E180094A; Tue, 11 Mar 2025 09:34:08 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 52B9Y4pY2192142 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 11 Mar 2025 10:34:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 52B9Y21R2192140; Tue, 11 Mar 2025 10:34:02 +0100 Date: Tue, 11 Mar 2025 10:34:02 +0100 From: Jakub Jelinek To: Richard Biener , rdubner@symas.com, jklowden@schemamania.org Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] cobol: Use *.cc suffix for bison/flex generated C++ files Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: UdeZqQaCPcDH3b6c9ZRdv4RYxnnfULkLmnqHO7vA1Y0_1741685650 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.5 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_H5, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Jakub Jelinek Errors-To: gcc-patches-bounces~patchwork=sourceware.org@gcc.gnu.org Hi! In GCC 12 we've switched to using *.cc suffixes for C++ sources in GCC sources, including generated files, instead of using *.c suffixes and compiling them as C++ anyway (that was the case since we've switched GCC to C++ in GCC 4.8). I've noticed gcc/cobol has 3 generated files still with c extension despite clearly having C++ code in it and being compiled as C++. This patch fixes it, tested on x86_64-linux, ok for trunk? 2025-03-11 Jakub Jelinek * Make-lang.in (cobol/parse.c, cobol/cdf.c, cobol/scan.c): Remove. (cobol/parse.cc, cobol/cdf.cc, cobol/scan.cc): New goals. (cobol/cdf.o): Depend on cobol/cdf.cc rather than cobol/cdf.c. (cobol/parse.o): Depend on cobol/parse.cc rather than cobol/parse.c. (cobol/scan.o): Depend on cobol/scan.cc rather than cobol/scan.c, on cobol/cdf.cc rather than cobol/cdf.c and on cobol/parse.cc rather than cobol/parse.c. (cobol.srcextra): Depend on cobol/parse.cc cobol/cdf.cc cobol/scan.cc rather than cobol/parse.c cobol/cdf.c cobol/scan.c. Jakub --- gcc/Make-lang.in.jj 2025-03-11 09:18:21.568136095 +0100 +++ gcc/Make-lang.in 2025-03-11 09:57:19.026823436 +0100 @@ -150,12 +150,12 @@ gcobol$(exeext): \ # First, files needed for parsing: -cobol/parse.c: cobol/parse.y +cobol/parse.cc: cobol/parse.y $(BISON) -o $@ $(YFLAGS) \ --defines=cobol/parse.h \ --report-file=cobol/parser.out $< -cobol/cdf.c: cobol/cdf.y +cobol/cdf.cc: cobol/cdf.y $(BISON) -o $@ $(YFLAGS) \ --defines=cobol/cdf.h --report-file=cobol/cdf.out $< @@ -163,7 +163,7 @@ cobol/cdf.c: cobol/cdf.y # in Flex manual. We suppress those messages, as a convenience. FLEX_WARNING = warning, dangerous trailing context -cobol/scan.c: cobol/scan.l +cobol/scan.cc: cobol/scan.l $(FLEX) -o$@ $(LFLAGS) $< >$@~ 2>&1 awk '! /$(FLEX_WARNING)/ {print > "/dev/stderr"; nerr++} \ END {print "$(FLEX):", NR, "messages" > "/dev/stderr"; \ @@ -179,9 +179,9 @@ cobol/scan.c: cobol/scan.l # The below lists of include files for the the generated files is # postprocessed: the files are one per line, used "realpath # --relative-to=$PWD" to rationalize them, and sorted. We include -# parse.c in the list for scan.o because that's the one make(1) knows about. +# parse.cc in the list for scan.o because that's the one make(1) knows about. -cobol/cdf.o: cobol/cdf.c \ +cobol/cdf.o: cobol/cdf.cc \ $(srcdir)/cobol/cbldiag.h \ $(srcdir)/cobol/cdfval.h \ $(srcdir)/cobol/copybook.h \ @@ -192,7 +192,7 @@ cobol/cdf.o: cobol/cdf.c \ $(srcdir)/../libgcobol/ec.h \ $(srcdir)/../libgcobol/exceptl.h -cobol/parse.o: cobol/parse.c \ +cobol/parse.o: cobol/parse.cc \ $(srcdir)/cobol/cbldiag.h \ $(srcdir)/cobol/cdfval.h \ $(srcdir)/cobol/cobol-system.h \ @@ -217,7 +217,7 @@ cobol/parse.o: cobol/parse.c \ auto-host.h \ config.h -cobol/scan.o: cobol/scan.c \ +cobol/scan.o: cobol/scan.cc \ $(srcdir)/cobol/cbldiag.h \ $(srcdir)/cobol/cdfval.h \ $(srcdir)/cobol/cobol-system.h \ @@ -243,8 +243,8 @@ cobol/scan.o: cobol/scan.c \ $(srcdir)/../libgcobol/io.h \ auto-host.h \ config.h \ - cobol/cdf.c \ - cobol/parse.c + cobol/cdf.cc \ + cobol/parse.cc # # The src targets are executed if @@ -260,7 +260,7 @@ cobol/scan.o: cobol/scan.c \ # not require Bison. Release tarballs always include Flex/Bison # output, and do not require those tools to be installed. # -cobol.srcextra: cobol/parse.c cobol/cdf.c cobol/scan.c +cobol.srcextra: cobol/parse.cc cobol/cdf.cc cobol/scan.cc ln -f $^ cobol/parse.h cobol/cdf.h $(srcdir)/cobol/