Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Oct 2020 08:07:02 -0400
From:      Diane Bruce <db@db.net>
To:        "Julian H. Stacey" <jhs@berklix.com>
Cc:        Stefan Esser <se@freebsd.org>, freebsd-stable <freebsd-stable@freebsd.org>, Greg Balfour <greg.bal4@gmail.com>
Subject:   Re: calendar (1) - patch to correct error description
Message-ID:  <20201029120702.GA44939@night.db.net>
In-Reply-To: <202010290029.09T0Td4m004819@fire.js.berklix.net>
References:  <3ec7872e-c264-e05f-cc3b-bbd2f421a97f@freebsd.org> <202010290029.09T0Td4m004819@fire.js.berklix.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 29, 2020 at 01:29:39AM +0100, Julian H. Stacey wrote:
> Hi Stefan
> > Am 28.10.20 um 13:02 schrieb Julian H. Stacey:
> > > 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:

If I was asked about this I'd suggest ripping out the internal cpp
and switching back to an external cpp IFF calendar is all in ports.
The idea when the original very hurried hack was done was to remove 
more from base. No longer a problem if using ports.



> > > ---
> > > // Test data for ~/.calendar/calendar
> > > *	bla0

...
> > This is not obvious from reading the man-page and it might be more
> > intuitive, if the identifier was only the word up to the first blank,
> 
> Yes
> 
> > but the code in the calendar program does just strip off leading and 
> > trailing white-space. It might be too late to change this behavior.
> 
> Hopefully not too late. 
> Either way, Ameliorations:
> - Do a global edit in manual from "cpp" to "pre-processor"
>   to remove expectation of similarity to cpp.
> - Define in manual exactly how the pre-processor handles defines.
> 
> 
> > I have updated the code in -CURRENT to support #ifdef (MFC in 3 days)
> 
> Nice 
> 
> 
> > and I plan to add supported for nested conditions in -CURRENT 
> 
> Nice
> 
> 
> > (not
> > sure whether that should be merged to -STABLE, though).
> 
> Probably yes ?
> 
> 
> > I could change the #define and #if/ifndef to only consider the first
> > following word, but do not plan to do that at this time.
> 
> Would be good if you did, silently swallowing space seperated text
> as extended name of a define instead of value of define, is not
> intuitive, At least document if you have no time to change it please ?
> 
> Fixing documenting & extanding a pp in calendar could become like
> re-inventing the wheel ?  As a cpp is in src/ & not ports, can't
> calendar use popen(/usr/bin/cpp) & save work ?  Looks like there's
> enough work to do in main calendar without extra work of a custom
> pre processor ?
> 
> Thanks for copy of your reply to Greg Balfour's off list mail, ref
> 	https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205580
> which notes:
> 	"This patch is against 11.4-RELEASE.  Note that it requires
> 	the installation of the devel/tradcpp port/package."
> 
> I agree your policy point, FreeBSD can't use a port as dependency
> to build calendar, while calendar is still build by src/ world.  (&
> not just for Free, but Net & Open BSD etc will have similiar views
> I presume)

Indeed I'd revert back to this.

> 
> I don't know which cpp's from where might have been looked at in the past,
> 
> > Regards, STefan
> 
> Thanks !
> 
> 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

Diane
-- 
- db@FreeBSD.org db@db.net http://www.db.net/~db



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201029120702.GA44939>