From owner-freebsd-stable@freebsd.org Wed Oct 28 12:02:27 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7333E444EB2 for ; Wed, 28 Oct 2020 12:02:27 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4CLnJ31w5yz42jk for ; Wed, 28 Oct 2020 12:02:27 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.nyi.freebsd.org (Postfix) id 3FE1D444D3E; Wed, 28 Oct 2020 12:02:27 +0000 (UTC) Delivered-To: stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3FA83444CC1 for ; Wed, 28 Oct 2020 12:02:27 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from slim.berklix.org (slim.berklix.org [94.185.90.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "slim.berklix.org", Issuer "slim.berklix.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CLnJ21hRwz42Ll for ; Wed, 28 Oct 2020 12:02:25 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (p4fc4cc8e.dip0.t-ipconnect.de [79.196.204.142]) (authenticated bits=128) by slim.berklix.org (8.15.2/8.15.2) with ESMTPSA id 09SC2D5o020203 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 28 Oct 2020 13:02:17 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id 09SC2Dbm088883 for ; Wed, 28 Oct 2020 13:02:13 +0100 (CET) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id 09SC23PC035979 for ; Wed, 28 Oct 2020 13:02:13 +0100 (CET) (envelope-from jhs@berklix.com) Message-Id: <202010281202.09SC23PC035979@fire.js.berklix.net> To: stable@freebsd.org Subject: calendar (1) - patch to correct error description From: "Julian H. Stacey" Organization: http://berklix.com/jhs/ User-agent: EXMH on FreeBSD http://www.berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ Date: Wed, 28 Oct 2020 13:02:03 +0100 X-Rspamd-Queue-Id: 4CLnJ21hRwz42Ll X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jhs@berklix.com has no SPF policy when checking 94.185.90.68) smtp.mailfrom=jhs@berklix.com X-Spamd-Result: default: False [1.46 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jhs]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.22)[-0.219]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[stable@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DMARC_NA(0.00)[berklix.com]; NEURAL_SPAM_SHORT(0.24)[0.240]; NEURAL_SPAM_MEDIUM(0.54)[0.536]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:33824, ipnet:94.185.88.0/22, country:DE]; RCVD_TLS_LAST(0.00)[]; MAILMAN_DEST(0.00)[stable]; RECEIVED_SPAMHAUS_PBL(0.00)[79.196.204.142:received] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 12:02:27 -0000 man calendar states: "The calendar internal cpp does not correctly do #ifndef and will discard the rest of the file if a #ifndef is triggered." That is wrong, as proved by test file: --- // Test data for ~/.calendar/calendar * bla0 #ifdef DEBUG1 * 28 bla1 #endif #ifdef DEBUG2 * 28 bla2 #endif #ifndef DEBUG3 * 28 bla3 #endif #define DEBUG4 TRUE #ifndef DEBUG4 * 28 bla4 #endif * 28 bla5 --- Produces: --- Oct 28 bla5 Oct 28 bla4 Oct 28 bla3 Oct 28 bla2 Oct 28 bla1 --- Correction: The calendar internal cpp ignores directives #ifdef , #ifndef and #endif , and simply including intervening text regardless. Patch built Wed Oct 28 12:39:27 CET 2020 on .ctm_status src-12 914 .svn_revision 366896 : --- http://www.berklix.com/~jhs/src/bsd/fixes/freebsd/src/gen/usr.bin/calendar/calendar.1.ifdef.REL=12.2-STABLE.diff *** 12.2-STABLE/src/usr.bin/calendar/calendar.1 Wed Oct 21 01:14:23 2020 --- new-generic/src/usr.bin/calendar/calendar.1 Wed Oct 28 12:33:12 2020 *************** *** 323,330 **** .Sh BUGS The .Nm ! internal cpp does not correctly do #ifndef and will discard the rest ! of the file if a #ifndef is triggered. It also has a maximum of 50 include file and/or 100 #defines and only recognises #include, #define and #ifndef. --- 323,330 ---- .Sh BUGS The .Nm ! internal cpp ignores directives #ifdef , #ifndef and #endif , ! and simply including intervening text regardless. It also has a maximum of 50 include file and/or 100 #defines and only recognises #include, #define and #ifndef. --- Later I could file this with send-pr, but before that I'm chasing another calendar cpp error (maybe which cpp is used may need to be considered, & that might reflect into discussion of which cpp used on which BSDs) Cheers, -- Julian Stacey, Consultant Sys. Eng. BSD Linux Unix, http://berklix.com/jhs/cv/ Crash Brexit profits financial speculators in cabinet damaging Britain. UK stole 3.7 million votes from Brits abroad 700 K in EU http://stolenvotes.uk